Here's why:
* The angle of the sun: The sun is highest in the sky at midday, casting the shortest shadows. As the sun gets lower in the sky towards sunset, the angle becomes more acute, lengthening the shadows.
Think of it this way: Imagine a flashlight shining directly down on an object. The shadow will be small. Now, tilt the flashlight to the side. The shadow will stretch out. The same principle applies to the sun and shadows.