Discrete (DTCs) and continuous time crystals (CTCs) are novel dynamical many-body states, that are characterized by robust self-sustained oscillations, emerging via spontaneous breaking of discrete or continuous time translation symmetry. DTCs are periodically driven systems that oscillate with a subharmonic of the external drive, while CTCs are continuously driven and oscillate with a frequency intrinsic to the system. Here, we explore a phase transition from a continuous time crystal to a discrete time crystal. A CTC with a characteristic oscillation frequency ωCTC is prepared in a continuously pumped atom-cavity system. Modulating the pump intensity of the CTC with a frequency ωdr close to 2ωCTC leads to robust locking of ωCTC to ωdr/2 , and hence a DTC arises. This phase transition in a quantum many-body system is related to subharmonic injection locking of non-linear mechanical and electronic oscillators or lasers.