How to Dress for Hiking
The way you need to dress for hiking largely depends on the conditions you plan on hiking in. You need significantly less coverage for a quick hike in the heat of summer than you need for an extended hike in the middle of winter. Regardless of the specifics, however, you should wear clothes that wick away moisture from your skin while preventing precipitation from getting you wet. You should also dress in a base, insulating, and shell layer.
Base Layer

Avoid heavy base layers if you plan on hiking in warm weather.
Long underwear is smart for colder weather, but it does not make much sense if you plan on hiking through the woods in the middle of summer.

Wear the right thickness of thermal underwear for cool weather.
Thermal underwear comes in light, mid, and expedition weights. The colder the conditions and the longer you plan on being out in them, the heavier you should go with.

Avoid cotton.
Cotton soaks up moisture, meaning that your clothes will get damp, uncomfortable, and may even cause you to catch a chill in cold weather once you start sweating.
See Cotton Vs. Wool

Look for fabrics that wick moisture away from your skin.
Merino wool and some silk can accomplish this task, but specially designed synthetic fabrics may do the most thorough job of it. Look for athletic wear that specifically advertises "wick-away" capabilities.
See Cotton Vs. Wool

Layer your socks for maximum comfort.
Wear a thin polyester sock liner on the inside and a thicker wool sock on the outside. Doing so may also help prevent the formation of blisters after long hikes.