As long as you want to. Slower dry = better flavors and better burning weed. Dry it out too fast and you're left with shit tasting buds. Read the stickies up top of this section.
Minimum 2 weeks for air, 1 week for water (with careful speed-drying). Air cure only gets better with age as the chlorophyll gets used up, etc, but make sure it doesn't get too dry.