Here's why:
* Angle of the sun: The sun is at its lowest point in the sky at sunrise and sunset. This low angle means the sun's rays hit the earth at a more acute angle.
* Longer shadow: The more acute the angle of the sun's rays, the longer the shadow cast by an object.
Think of it like this: imagine shining a flashlight directly down onto an object. The shadow will be short. Now, tilt the flashlight so it shines at a more shallow angle. The shadow will stretch out much longer.