A shadow forms when an object blocks sunlight. The shadow always falls on the side of the object away from the Sun.
The Earth spins on its axis once every 24 hours. As it spins, the Sun seems to rise in the east, travel across the sky and set in the west. The Sun is not really moving across our sky — we are turning.
When the Sun is low in the sky, in the early morning and late afternoon, shadows are long. When the Sun is high, around the middle of the day, shadows are short.
Because shadows change in a regular way, people long ago used them to tell the time with a sundial.