  We study the gravitational production of dark photon dark matter during
inflation, when dark photons acquire mass by the Higgs mechanism. In the
previous study, it was assumed that the dark photon has a St\"uckelberg mass,
or a mass generated by the Higgs mechanism with a sufficiently heavy Higgs
boson. In this paper we consider a case in which the Higgs boson is not fully
decoupled; the Higgs field changes its vacuum expectation value after
inflation. Then, the dark photon mass also changes with time after inflation,
and the time evolution of the longitudinal mode is different from the case with
a St\"{u}ckelberg mass. Consequently, the spectrum of the dark photon energy
density can have two peaks at an intermediate scale and a small scale. We show
that the dark photon can explain the dark matter if its current mass is larger
than $6 \, \mu {\rm eV} \times (H_I / 10^{14} \, {\rm GeV})^{-4}$ and smaller
than $0.8 \, {\rm GeV} \times (H_I / 10^{14} \, {\rm GeV})^{-3/2}$, with $H_I$
being the Hubble parameter during inflation. A higher mass is required if one
considers a larger gauge coupling constant. The result for the St\"uckelberg
mass can be reproduced in the limit of a small gauge coupling constant. We also
comment on the constraints set by various conjectures in quantum gravity
theory.
