PurposeTo investigate the association between mental disorders and substance misuse at 30 years of age with gender, socioeconomic position at birth, and family income trajectories.MethodsThe 1982 Pelotas Birth Cohort was used; all 5914 children born alive at hospital were originally enrolled (99.2% of all city births). In 2012, 3701 subjects were located and interviewed (68% retention rate). Mental disorders and substance misuse were assessed, and their prevalence analysed according to gender, socioeconomic status at birth, and four different income trajectories: always poor, never poor, poor at birth/non-poor at age 30, and non-poor at birth/poor at age 30.ResultsWhile women presented higher prevalence of mental disorders, substance misuse was much more frequent among men. Individuals in the lowest income quintile at birth presented 2–5 times more mental disorders and substance misuse than those in the highest quintile. Young adults who were always poor or were not poor at birth but were poor at 30 years of age had a higher prevalence of mental disorders than the other groups.ConclusionsThe high rates of mental disorders and lifetime suicide attempts in young adults, especially those who were always poor or became poor after childhood, suggest that recent socioeconomic-related stressful situations may have a higher impact on the current mental health than events earlier in life. However, we could not identify at what specific ages socioeconomic changes were more important.Electronic supplementary materialThe online version of this article (10.1007/s00127-018-1526-x) contains supplementary material, which is available to authorized users.