The box will cast a shadow that is cast to the left and away from us because the light source is to the right and closer to us than the box itself. The shape of the shadow on the ground is related to the corners of the box and the angle of the shadow lines is determined by a vanishing point on the ground plane. Directly above that point is the light source. When the light source is so close to the box that it appears within the picture frame that light source is a man made one- not the sun. Think Lamppost or stage lighting, etc. The length of the shadow lines is determined by the height of the light source.
Here the box is lit by the sun at basically the same angle. The sun is much farther away than the lamppost so we will project the shadow direction lines (on the ground plane) and the shadow length control lines as parallels.
Shadows casting forward. When the sun is farther away from us than the object and so low to the horizon that it appears within the picture plane the shadows will cast toward us. The use of a vanishing point on the horizon and the vanishing point directly above it are the same as in the first drawing.
Shadows will change direction when they fall onto another vertical surface. the rules stay the same but you must be conscious of the point where the length controlling line meets the shadow direction line.
Practice what you know by sketching quickly. Freehand the horizon line, the vanishing lines and the verticals. Add shadows as quickly as you can- think of the rules you learned in the shadow casting exercises but just draw them quickly. Notice that the only vanishing lines I used for the shadows are on the ground plane, and vanish to the same v.p.s as the boxes are using- that is because those lines indicate the part of the shadow cast by the top edge of the box.
There is a difference between Shade and shadow. Shade (orange) is the absence of light and the shadow (Magenta) is an object of darkness cast upon the ground, or other surfaces.
Atmospheric perspective. When you render the shade side and the shadow make the leading edges darker- they are closer to the light source and have a stronger contrast than the trailing edges. This is because of distance and backfill lighting.