Estirarse vs. hacer estiramientos vs. desperezarse

The Spanish language offers different words to express the concept of 'stretching' which include 'estirarse', 'hacer estiramientos' and 'desperezarse'. Despite having a common theme, these words are used in distinct contexts or situations.

Estirarse

It closely translates to 'stretching oneself', typically it is targeted at a particular body part. This term is used frequently.
Me voy a estirar las piernas.
(I am going to stretch my legs.)
Necesito estirarme un poco antes de correr.
(I need to stretch myself a bit before running.)

Hacer estiramientos

'Hacer estiramientos' is a phrase which means ‘to do stretches’. It usually refers to several stretching exercises, often as part of a warm-up or cool-down process during physical activity.
Es importante hacer estiramientos antes de comenzar cualquier actividad física.
(It's important to do stretches before starting any physical activity.)
Suelo hacer estiramientos por las mañanas para activar mi cuerpo.
(I usually do stretches in the morning to activate my body.)

Desperezarse

'Desperezarse' translates to ‘stretching oneself’ as well, but it is specifically used when someone is waking up from sleep or from sitting/lying for long periods. The act of stretching in this case can also be accompanied with yawning itself.
Al despertar, es normal desperezarse para quitarse el sueño.
(Upon waking up, it's normal to stretch oneself to get rid of sleepiness.)
Después de estar sentado trabajando durante horas, Antonio se despereza antes de pararse.
(After being seated working for hours, Antonio stretches before standing up.)

Summary

In summary, Spanish makes a clear distinction between general stretching (estirarse), doing stretching exercises (hacer estiramientos), and stretching upon waking or after sitting or lying down for long periods (desperezarse).