Zeugodacus cucurbitae (Coquillett) is a highly damaging agricultural pest in many tropical and subtropical countries around the world and high temperatures usually affect its survival. To clarify the effect of short-term high temperatures on the survival and lifespan of Z. cucurbitae, newly emerged adults of three consecutive generations (F1, F2, and F3) were exposed to 25 °C, 33 °C, 37 °C, 41 °C, or 45 °C treatments for 1 h. The effect of these temperatures on survival and lifespan was evaluated using biological indicators such as lifespan and pupation rate. Then, to study the molecular regulatory mechanism of the lifespan of Z. cucurbitae after short-term high-temperature treatment, we exposed the newly emerged adults to 25 °C or 45 °C treatments for 1 h and used siRNA to interfere with the expression of the vitellogenin receptor (VgR) gene in the female to study the effect of the VgR gene on the lifespan of Z. cucurbitae. The results showed that the survival rate, lifespan, pupae weight, pupation rate, and emergence rate of Z. cucurbitae decreased with increased temperature, while the female sex ratio of offspring increased. The heat resistance of females was higher than that of males. Interference with the expression of the VgR gene resulted in shortening of the female’s lifespan by approximately 60% after exposure to 25 °C or 45 °C treatments for 1 h, which indicated involvement of the VgR gene in the regulation of Z. cucurbitae lifespan. This study provides a reference to guide integrated control of Z. cucurbitae in high-temperature seasons.