Because the sun's position in the sky changes, and its light strikes an object at different angles. The shallower the angle that the light strikes the object relative to the surface of the earth, the longer the object's shadow will be.
Didn't find the answer you were looking for?