You may do this when you're tired or after a nap. This movement is usually called "yawning" but I think yawning is a bit different. With this movement, we may yawn too. After waking up, it usually comes with a yawning but when we are tired, we usually don't yawn with. And this movement makes us feel better.
The picture below is an example of this movement:
The picture's source: nordic-comfort.co.uk
In some languages, like Persian (aka Farsi), there is no difference between yawning and this movement but in some other languages like Azerbaijani, there is a difference.
Best Answer
There is a specific name for it: pandiculation.
Joseph Ducreux pandiculating; self-portrait ca 1783
Note: While stretching is more common, it is also more general. OP didn't specifically asked for a common word and there are details in the question. Pandiculation is a tailor-made word for this specific movement. At least, you learned a new word if you didn't know it.