A search for Higgs boson pair production via gluon-gluon fusion in final states with two photons and one or more leptons is presented. The analysis is based on data from proton-proton collisions at a center-of-mass energy of 13 TeV collected with the CMS detector at the LHC, corresponding to an integrated luminosity of 138 fb^-1. No significant excess above the background-only prediction is observed. An upper limit is set on the gluon-gluon fusion Higgs boson pair production cross section. The observed (expected) 95% confidence level (CL) upper limits are found to be 25 (23) times the Standard Model (SM) prediction. Assuming all other couplings of the Higgs boson have values as predicted by the SM, the observed (expected) constraints on the modifier of the Higgs boson trilinear self-coupling kl are found to be -11.1 < kl < 16.6 (-8.7 < kl < 14.7) at 95% CL.