Developmental science suggests that the consequences of mental health problems for life-course outcomes may depend on the timing of their onset. This study investigated the extent to which mental health predicted educational attainment at ages 17, 20, and 25 and whether gender moderated the links between mental health and educational attainment. It used data from Next Steps, a nationally representative panel survey of individuals born in 1989/1990 in England (N = 15,594, 48% female, 33% ethnic minority). The findings suggest that differences in mental health were more consequential for educational attainment during adolescence than in young adulthood. On average, girls attained higher levels of education than boys, but gender did not moderate the role that mental health played for educational attainment. (PsycInfo Database Record (c) 2023 APA, all rights reserved)