The algorithms used by the ATLAS Collaboration to reconstruct and identify prompt photons are described. Measurements of the photon identification efficiencies are reported, using 4.9 fb$^{-1}$ of pp collision data collected at the LHC at $\sqrt{s} = 7$ $\text {TeV}$ and 20.3 fb$^{-1}$ at $\sqrt{s} = 8$ $\text {TeV}$ . The efficiencies are measured separately for converted and unconverted photons, in four different pseudorapidity regions, for transverse momenta between 10 $\text {GeV}$ and 1.5 $\text {TeV}$ . The results from the combination of three data-driven techniques are compared to the predictions from a simulation of the detector response, after correcting the electromagnetic shower momenta in the simulation for the average differences observed with respect to data. Data-to-simulation efficiency ratios used as correction factors in physics measurements are determined to account for the small residual efficiency differences. These factors are measured with uncertainties between 0.5% and 10% in 7 $\text {TeV}$ data and between 0.5% and 5.6% in 8 $\text {TeV}$ data, depending on the photon transverse momentum and