Why there's so much confusion about stretching
Few topics generate as many myths as stretching. For decades we were told to stretch at length before exercise to avoid injury, and afterwards to erase soreness. The science has moved on, but the old reflexes remain ingrained. Before talking about the "right moment", we need to clarify what we mean, because everything depends on the type of stretch.
Static versus dynamic
A static stretch means bringing a muscle into a lengthened position and holding it, motionless, for several seconds. A dynamic stretch instead moves the joint through its full range in a controlled, repeated way: leg swings, rotations, walking lunges. The first aims mainly at lengthening and release; the second prepares the body for movement. Confusing the two is the first source of error.
Flexibility and mobility are not the same
Flexibility is the range a muscle can reach passively, when stretched. Mobility is the range you can control actively, with strength, in a real movement. You can be very flexible yet have poor mobility, lacking strength in the extreme ranges. For most people, it's useful mobility that truly matters day to day and in training, and it's built as much by strength work as by stretching.
What stretching is not
Stretching is not a warm-up on its own, nor a guarantee against injury, nor a cure for soreness. It's an excellent tool for maintaining and developing flexibility, releasing tension and improving your body awareness. The whole point is to give it the right role, at the right time, without crediting it with powers it doesn't have.