Note: In this series of lessons only manual methods of images editing will be described. Plug-ins will not be touched because they are not multipurpose and totally illegal. (Please show me the person who has the license.) And every respected professional should be able to edit images manually.
Theory
Shadows are considered to be one of stumbling blocks for all designers. They usually judge the quality of works as well as designer’s level of mastering from the shadows. There are some stereotypes or so called rules of good forms that we are judging the quality of shadows from.
Note: In this series of lessons only manual methods of images editing will be described. Plug-ins will not be touched because they are not multipurpose and totally illegal. (Please show me the person who has the license.) And every respected professional should be able to edit images manually.
Theory
Shadows are considered to be one of stumbling blocks for all designers. They usually judge the quality of works as well as designer’s level of mastering from the shadows. There are some stereotypes or so called rules of good forms that we are judging the quality of shadows from.
Besides, statement that photorealistic shadow is good and non-photorealistic shadow is bad is totally incorrect. Very often one has to correct and adjust photorealistic shadow in order to get a clear and qualitative element of site design. Also one should have to sketch out a shadow in order to emphasize an important block or a menu.
Below you can find three main rules on shadows imaging.
Rule 1: Shadow should not be a mud
Pictures below show how shadow should not be made. Too sharp changes from white to black are shown here. Such changes are quite rare while natural daylight.

And I have considered first rule here

Shadow here is much brighter and transparent. It does not draw attention back. Shadows as on the Pic 2a and Pic 2b are commonly used at corporate sites. And it is of no good that designers take it as a feature of a bad form.
Exception:
If it is night on the picture and our object is lightened with a lamp, shadows are very contrasting then. It all depends on lightening. In this lesson we talk about common case, when the daylight is used.
Rule 2: Shadow is not imposition of the black color
On the Internet I saw some lessons on shadow imaging. They image shadows by setting black color in different proportions and different transparency. This is not correct. Shadow is an area where direct light does not reach to. And this means that this area is painted with the natural color of the object. It may even seem to be richer rather than the area where the light lies to, in case the object has rather bright own color.
Also while choosing the shadow color, one should pay attention to the fact that the object itself may reflect the light to the flatness partially. If the object is of a bright red color, for example, then it would reflect part of the red color to the flatness where the object is.
Examples of what should not be done:

And what should be done:

Short description on how to get shadows as on Pic 4a and 4b:
Pic 4a:
According to the first two rules, one should not make dark shadow of a black color. At the layer style toolbar we chose color overlay and then chose the color itself. We chose dark brown – one that the surface might have been without the daylight.
Pic 4b:
The main background is white, shadow color is grey. Red board also casts red color on the surface. That is why we duplicate the grey layer of the shadow, repaint it to the dark red color and erase those areas which are not close to the red surface directly. As a result, shadow near our board has a subtle red shade rather than far from it.
Rule 3: darker and clearer if closer
We are talking here not about point source of light but about distributed one by default. This rule comes from the physic peculiarities of light transmission from the distributed source.

The following shadow is made in this way:
Firstly we create a usual shadow layer. Then, far from the board, the layer is blurred. Right and left sides (far from the object, but close to us) are slightly wiped up with the help of eraser, in order to avoid too distinct sides of the shadow at the end.
There are other variants.
I would not call it wrong solution. Although it looks like the whole board simply overhang the surface under the daylight.
Here the board is lightened with the help of a distinct artificial source.
Practice
Example 1: Shadow of a cube
Initial cube:

Firstly, let’s make the shadow in direct close to the cube. According to the third rule it is the darkest area. Retouch the cube itself in order it is a bit darker on its foundation, and draw the near-by area of the shadow.

And now let’s add the main shadow, much blurred as it is much far from the cube.

We have a good shadow of a cube which stands on some surface under the daylight now. If we want to make a shadow from the sun or some lamp, we use third rule then. Also note that the shadow is not of a black color, as the object is of a green color, and is not much dark.

Example 2: shadow of a toy car
Initial cut image:

Recall the rule Darker and clearer if closer.
Determine which part of a car is nearest to the surface. Obviously, the wheels. Let’s build the way for the wheels – actually you should not build anything but I will describe everything by steps for your clearness – in order to determine the surface where the car stands on:

Now lets show places where wheels are nearest to the surface with green lines.

Draw the clear black shadows in the area of wheels.

Blur up and lessen the richness in those places where the wheels are not that close to the ground – recall 1 and 3 rules:
Now duplicate the shadow layer and blur it along the gauss. Because of the daylight, shadow from the wheels is situated on all sides rather than on some exact directions from the wheels. Recall the first rule. Adjust the transparency.

Further we draw the shadow from the body of a car itself. It is heterogeneous. There are places situated closer to the surface as well as remote places. Firstly, draw the homogeneous shadow, which the body of the car would cast in case it is homogeneous itself. And then simply add some shadows where needed and erase them where they are not required. Do not forget about the second rule. Still the car is bright red and may cast a subtle red shade, though not necessarily. With the help of layers styles and also color overlay, we change the black color to the slight vinous.

Note that the front part of the car as well as the left footboard is much near to the urface. Substitute them additionally, following the first rule.

As a result we have a good and realistic enough shadow of a car.
Note:
It is not a manual on how to make a realistic shadow. If your aim is to produce a realistic shadow from the real objects, design it with the help of editors as the real shadow is much more difficult quite often. And the aim of this lesson is to show shadows which look like the real ones, can be used for the designs of different sites and which do not take 5 hours to be drawn.