In general, active mobility (warmup through movement, taking joints through increasingly full range of motion) is best done before workouts, and passive stretching (ie traditional stretch-and-hold type stretches) afterwards.
But how much passive stretching to do? A recent study suggests that a couple of 30-second passive stretches may be sufficient to decrease stiffness.
Ryan, Eric D, et al. Determining the minimum number of passive stretches necessary to alter musculotendinous stiffness. Journal of Sports Sciences, Volume 27, Issue 9 July 2009 , pages 957 – 961
In this study, we examined the minimum number of constant-torque passive stretches necessary to reduce musculotendinous stiffness. Thirteen healthy individuals (mean age 22 years, s = 3; stature 1.67 m, s = 0.1; mass 66 kg, s = 13 kg) volunteered to participate in the investigation and underwent four 30-s constant-torque passive stretches of the plantar flexor muscles. Musculotendinous stiffness was examined from the angle-torque curves generated prior to the passive stretches, at the beginning of each 30-s stretch, and immediately following the four 30-s passive stretches. The results indicated that musculotendinous stiffness of the plantar flexors was reduced following two 30-s constant-torque passive stretches (P < 0.05) compared with the pre- musculotendinous stiffness assessment. Musculotendinous stiffness remained depressed following the third and fourth stretches, but did not decrease further. These findings suggest that two 30-s bouts of constant-torque passive stretching may be necessary to cause a significant decrease in musculotendinous stiffness of the plantar flexor muscles.