At the end of my Zumba class, we do a lunge for each leg. We also put one leg out in front of the other, with the weight on the back leg and the heel of the front foot planted and the toes flexed up. Then we lean forward slightly and feel the stretch on the back of the extended leg.
We also grab one foot and pull it up towards the butt while standing on the other leg, but I think that stretches the quads more than the hamstrings.