There exists some controversy over how long a stretch should be held. A good common ground seems to be about 20 seconds. If you're under 40, hold your stretches for 15-30 seconds. If you're over 40, hold them for 30-60 seconds. As you reach your 40s, your muscles become less pliable, so they need to be stretched longer. Children, and people whose bones are still growing, do not need to hold a passive stretch this long. Holding the stretch for about 7-10 seconds should be sufficient for this younger group of people.
Spend twice as much time stretching your tight muscles as your flexible muscles - focus on problem areas.
Many sources also suggest that passive stretches should be performed in sets of 2-5 repetitions with a 15-30 second rest in between each stretch.
Remember to warm-up and to avoid overstretching. Stretching should not be painful.