The localization of light in flat-band lattices has been recently proposed and experimentally demonstrated in several configurations, assuming a classical description of light. Here we study the problem of light localization in the quantum regime. We focus on quasi-one-dimensional and two-dimensional lattices which exhibit a perfect flat band inside their linear spectrum. Localized quantum states are constructed as eigenstates of the interaction Hamiltonian with a vanishing eigenvalue and a well defined total photon number. These are superpositions of Fock states with probability amplitudes given by positive as well as negative square roots of multinomial coefficients. The classical picture can be recovered by considering Poissonian superpositions of localized quantum states with different total photon number. We also study the separability properties of flat-band quantum states and apply them to the transmission of information via multicore fibers, where these states allow for the total passive suppression of photon crosstalk and exhibit robustness against photon losses. At the end, we propose an on-chip setup for the experimental preparation of localized quantum states of light for any number of photons.