Why are the top layers of my oil painting cracking when it starts to dry?
So the golden rule when layering oil paint is to work lean to fat (or fat over lean).

What does this actually mean? Lean paint is paint that is diluted with white-spirit or turpentine. It is 'watery', and dries quickly. Typically underpaintings are done in this way, as it's quick and easy to correct mistakes. As you then build up subsequent layers, use less spirits and more medium (typically linseed oil) - the oil being the 'fat'. These layers dry more slowly as a result.

Doing this ensures that the lower layers dry more quickly than the upper layers. Cracking happens when the top layers dry first, then the lower layers.

Some other considerations: cheaper paint will have more varied drying time between different colours. If you notice some particular colours cracking this may be the cause. Information about drying times is usually available on the manufacturer's website.