How I structure stretching in my warmups:
1) Self-Massage. This includes foam rolling, lacrosse ball rolling, rolling on a softer ball, etc. I pick 2-3 areas and do 1-2 types of rolls per area for 1 minute each.
2) Static Stretches. These are generally done for between 30 seconds and 2 minutes per area, total. I'll set stretches up in a circuit and rotate through 3-4 of them. Overall I try to keep the total to down to 3-4 minutes, if only because I generally train myself or other people with a time limit.
3) Dynamic Stretches / Mobility Drills. Time varies, but I progress from mild movements to larger and move aggressive movements. You might start with band pull aparts before going to external rotations and then to arm circles. For lower body I might do squats, then lunges, then work up to jumping jacks and rope skipping.
Overall, I like this to take 7-8 minutes minimum, 10-15 minutes maximum. Enough to get it all in, but not so much we're eating into a session's time. That's especially critical if clients are coming before work, before picking kids up from school, or otherwise have something they need to get to.
I will mix 2 and 3 if necessary. For a client with tight hip flexors, we often need to foam roll, then do some activation drills, and then stretch the flexors in order to get the most benefit. But I default to "roll, stretch, get mobile."
Joe DeFranco just did an excellent podcast on this subject, which I highly recommend.
At the end of the workout, I like to immediately do some stretching for problem areas. I pick one, done for 1-2 minutes per side, and then we're all done.
On an off day, I might mix all three for much longer - basically doing rolling, stretching, and mobility melded together for much longer. This turns an "off day" into a light workout aimed primarily at banking some stretching and mobilization.