A microscopic quantum system under continuous observation exhibits at random times sudden jumps between its states. The detection of this quantum feature requires a quantum non-demolition (QND) measurement1–3 repeated many times during the system’s evolution. Whereas quantum jumps of trapped massive particles (electrons, ions or molecules4–8) have been observed, this has proved more challenging for light quanta. Standard photodetectors absorb light and are thus unable to detect the same photon twice. It is therefore necessary to use a transparent counter that can ‘see’ photons without destroying them3. Moreover, the light needs to be stored for durations much longer than the QND detection time. Here we report an experiment in which we fulfil these challenging conditions and observe quantum jumps in the photon number. Microwave photons are stored in a superconducting cavity for times up to half a second, and are repeatedly probed by a stream of non-absorbing atoms. An atom interferometer measures the atomic dipole phase shift induced by the nonresonant cavity field, so that the final atom state reveals directly the presence of a single photon in the cavity. Sequences of hundreds of atoms, highly correlated in the same state, are interrupted by sudden state switchings. These telegraphic signals record the birth, life and death of individual photons. Applying a similar QND procedure to mesoscopic fields with tens of photons should open new perspectives for the exploration of the quantum-to-classical boundary9,10.