Phase transitions between different states of matter can profoundly modify the order in physical systems, with the emergence of ferromagnetic or topological order constituting important examples. Correlations allow the quantification of the degree of order and the classification of different phases. Here we report measurements of first-order spatial correlations in a harmonically trapped two-dimensional photon gas below, at and above the critical particle number for Bose-Einstein condensation, using interferometric measurements of the emission of a dye-filled optical microcavity. For the uncondensed gas, the transverse coherence decays on a length scale determined by the thermal de Broglie wavelength of the photons, which shows the expected scaling with temperature. At the onset of Bose-Einstein condensation, true long-range order emerges, and we observe quantum statistical effects as the thermal wave packets overlap. The excellent agreement with equilibrium Bose gas theory prompts microcavity photons as promising candidates for studies of critical scaling and universality in optical quantum gases.Phase transitions in quantum matter are related to correlation effects and they can change the ordering of material. Here the authors measure the first-order spatial correlation and the de Broglie wavelength for both thermal and condensed form of a photonic Bose gas in a dye-filled optical microcavity.