Proton-proton interactions resulting in final states with two photons are studied in a search for the signature of flavor-changing neutral current interactions of top quarks (t) and Higgs bosons (H). The analysis is based on data collected at a center-of-mass energy of 13 TeV with the CMS detector at the LHC, corresponding to an integrated luminosity of 137 fb-1. No significant excess above the background prediction is observed. Upper limits on the branching fractions (B) of the top quark decaying to a Higgs boson and an up (u) or charm (c) quark are derived through a binned fit to the diphoton invariant mass spectrum. The observed (expected) 95% confidence level upper limits are found to be 0.019% (0.031%) for B(t→Hu) and 0.073% (0.051%) for B(t→Hc). These are the strictest upper limits yet determined.