Cosmological evolution of light dark photon dark matter