The impossibility of perfectly copying (or cloning) an unknown quantum state is one of the basic rules governing the physics of quantum systems. The processes that perform the optimal approximate cloning have been found in many cases. These "quantum cloning machines" are important tools for studying a wide variety of tasks, e.g., state estimation and eavesdropping on quantum cryptography. This paper provides a comprehensive review of quantum cloning machines both for discrete-dimensional and for continuous-variable quantum systems. In addition, it presents the role of cloning in quantum cryptography, the link between optimal cloning and light amplification via stimulated emission, and the experimental demonstrations of optimal quantum cloning.