Temperature is increasingly understood to impact mental health. However, evidence of the long-term effect of temperature exposure on the risk of depressive symptoms is still scarce. Based on the China Health and Retirement Longitudinal Study (CHARLS), this study estimated associations between long-term apparent temperature, extreme temperature, and depressive symptoms in middle-aged and older adults. Results showed that a 1 °C increase or decrease from optimum apparent temperature (12.72 °C) was associated with a 2.7% (95% CI: 1.3%, 4.1%) and 2.3% (95% CI: 1.1%, 3.5%) increased risk of depressive symptoms, respectively. This study also found that each percent increase in annual change in ice days, cool nights, cool days, cold spell durations, and tropical nights was associated with higher risk of depressive symptoms, with HRs (95%CI) of 1.289 (1.114-1.491), 2.064 (1.507-2.825), 1.315 (1.061-1.631), 1.645 (1.306-2.072), and 1.344 (1.127-1.602), respectively. The results also indicated that people living in northern China have attenuated risk of low apparent temperature. Older people were also observed at higher risk relating to more cool nights. Middle-aged people, rural residents, and people with lower household income might have higher related risk of depressive symptoms due to increased tropical nights. Given the dual effect of climate change and global aging, these findings have great significance for policy making and adaptive strategies for long-term temperature and extreme temperature exposure.