Depression and suicidal ideation are prevalent mental health problems in patients with chronic kidney disease (CKD. However, the association between mental health problems and kidney disease has been investigated in severe cases only. Thus, this study evaluated the relationship between mental health problems and renal function in a community-based prospective cohort study comprising patients with mild to moderate kidney disease. A total of 44,938 participants who were participated in Korean National Health and Nutrition Examination Survey IV, V, and VI from 2007 to 2014 were enrolled. Estimated glomerular filtration rate (eGFR) was calculated using the CKD Epidemiology Collaboration equation. The study outcome was the prevalence of depression and suicidal ideations assessed by self-reporting surveys. Logistic regression analysis was performed to evaluate the relationship between renal function and outcomes. The mean age of the study subjects was 49.2 ± 16.6 years, and the mean eGFR was 94.0 mL/min/1.73 m2. The prevalence of depression and suicidal ideation increased with decreasing eGFR. Multivariate logistic regression analysis showed that the risk of depression increased in subjects with eGFR <45 mL/min/1.73 m2 [odds ratio (OR) 1.47; 95% confidence interval (CI) 1.09–1.98]. The risk of suicidal ideation gradually increased in groups with eGFR <90 mL/min/1.73 m2 (OR, 1.11; 95% CI, 1.03–1.20), even after adjustments for confounding variables. In conclusion, depression and suicidal ideation are related closely with renal dysfunction. The risk of having depression and suicidal ideation increased even in patient with mild renal dysfunction. Therefore, evaluation and management strategies regarding mental health problems should be taken into account throughout all stages of CKD.