We derive the second-order QCD corrections to the production of a Higgs boson recoiling against a parton with finite transverse momentum, working in the effective field theory in which the top quark contributions are integrated out. To account for quark mass effects, we supplement the effective field theory result by the full quark mass dependence at leading order. Our calculation is fully differential in the final state kinematics and includes the decay of the Higgs boson to a photon pair. It allows one to make next-to-next-to-leading order (NNLO)-accurate theory predictions for Higgs-plus-jet final states and for the transverse momentum distribution of the Higgs boson, accounting for the experimental definition of the fiducial cross sections. The NNLO QCD corrections are found to be moderate and positive, they lead to a substantial reduction of the theory uncertainty on the predictions. We compare our results to 8 TeV LHC data from ATLAS and CMS. While the shape of the data is well-described for both experiments, we agree on the normalization only for CMS. By normalizing data and theory to the inclusive fiducial cross section for Higgs production, good agreement is found for both experiments, however at the expense of an increased theory uncertainty. We make predictions for Higgs production observables at the 13 TeV LHC, which are in good agreement with recent ATLAS data. At this energy, the leading order mass corrections to the effective field theory prediction become significant at large transverse momenta, and we discuss the resulting uncertainties on the predictions.