A shadow is the patch of ground that light cannot reach because something is in the way. For a straight stick on flat ground, the light that just grazes the top of the stick lands at the tip of the shadow.
So the shadow's length depends only on how high the Sun is: length = stick height ÷ tan(Sun height). At 45° the shadow is exactly as long as the stick. And it always points directly away from the Sun.