This study was to describe the cognitive function status in patients with depressive disorder and to construct a nomogram model to predict the risk factors of cognitive impairment in these patients. From October 2019 to February 2021, a total of 141 patients with depressive disorder completed the survey in two hospitals. The Montreal cognitive assessment (MoCA) was used with a cutoff score of 26 to differentiate cognitive impairment. Univariable and multivariable logistic regression analyses were conducted to identify independent risk factors. A nomogram was then constructed based on the results of the multivariable logistic regression analysis. The patients had an average MoCA score of 23.99 ± 3.02. The multivariable logistic regression analysis revealed that age (OR: 1.096, 95% CI: 1.042–1.153, p < 0.001), education (OR: 0.065, 95% CI: 0.016–0.263, p < 0.001), depression severity (OR: 1.878, 95% CI: 1.021–3.456, p = 0.043), and sleep quality (OR: 2.454, 95% CI: 1.400–4.301, p = 0.002) were independent risk factors for cognitive impairment in patients with depressive disorder. The area under receiver operating characteristic (ROC) curves was 0.868 (95% CI: 0.807–0.929), indicating good discriminability of the model. The calibration curve of the model and the Hosmer–Lemeshow test (p = 0.571) demonstrated a well‐fitted model with high calibration. Age, education, depression severity, and sleep quality were found to be significant predictors of cognitive function. A nomogram model was developed to predict cognitive impairment in patients with depressive disorder, providing a solid foundation for clinical interventions.