As I'm painting with oils, I often layer new colors over older parts of the canvas. This generally works fine, but sometimes the upper layer can crack as it starts to dry. Why is this and what can I do to prevent it?
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.