If you have just had a hard leg workout, it is a good idea to perform a glute stretch immediately to reduce the risk of suffering from DOMS (delayed onset of muscle soreness). DOMS usually occurs about a day after your workout and is the most intense about 48 hours later. The thing about it however is that normally you will not feel it immediately therefore most people think they don't need to do a glute stretch. Don't fall trap to this misled belief.
One great glute stretch to perform is simply done by standing upright and then bending one knee while sticking out the same hip. As you stick the hip out, pull the upper body away from it until you feel a pull all along the side of your leg. Hold for a minute and then repeat along the other side.
A second movement you can do is started by sitting on the floor with one leg crossed over the other. This would be similar to the popular yoga position that yogis do. Next, take your arms and gently pull the leg that is nearest the top across your chest. This one will really target in on the hip and you should definitely increase your flexibility by doing it.
Lastly, this flexibility move is both great for increasing the range of motion and also for relaxation purposes. To perform it lay with your back down on the floor. Next bend at one knee and cross it over your body so it is resting on the floor beside you (the inside of the knee should try and touch the ground). Make sure you attempt to keep both shoulders touching the floor while you do this however. Not only will you likely feel the pull in the hip but also in your whole spine as well. Afterwards flip over and do it on the other leg as well.
So don't neglect to do these after a workout. You may not feel it to be necessary right after your lifting session but trust me, you'll regret it the next morning if you don't.