You should stretch your muscles when they are warm. It is best to do a little exercise to warm up before stretching. Warm muscles are more pliant and flexible, because more blood is being sent to them.
Stretching cold muscles could be dangerous, so you should stretch when your muscles are warm.