Burning mouth syndrome (BMS) is a chronic, painful condition of the oral mucosa. Although the pathogenesis remains unclear, psychological and neuroendocrine factors are considered the major contributors. Few longitudinal studies have investigated the effects of psychological factors on the occurrence of BMS. Therefore, we evaluated the risk of BMS in patients with affective disorders using a nationwide population-based cohort dataset. We identified patients with depression, anxiety, and bipolar disorder and then selected comparison participants using the 1:4 propensity score-matching method. We investigated the incidence of BMS events during the follow-up period using survival analysis, the log-rank test, and Cox proportional hazards regression models. After adjusting for other contributing conditions, the adjusted hazard ratio (HR) for developing BMS was 3.37 (95% confidence interval [CI]: 1.67–6.80) for depression and 5.09 (95% CI: 2.19–11.80) for anxiety; however, bipolar disorder showed no significant risk. Specifically, female patients with depression and anxiety had an increased risk of BMS. Moreover, patients with anxiety showed an increased adjusted HR of BMS events during the first 4 years after diagnosis, whereas patients with depression did not. In conclusion, depression and anxiety disorders are significantly associated with the risk of BMS. Additionally, female patients showed a significantly higher risk of BMS than male patients, and anxiety showed increased BMS events earlier than depression. Therefore, clinicians should consider the risk of BMS when treating patients with depression or anxiety.