5-8 seconds is considered ideal. More time always means more THC, but beyond that it's not enough to be worth the effort.

Exhaling immediately is definitely a waste. Not all of the smoke has had a chance to hit the avioli in your lungs, so not all of the THC is out. Coughing also causes the avioli to expand, which helps the THC hit you harder - while this doesn't actually increase the amount of THC in your system, many people find that it helps boost the subjective effects of the high.