Although the link between androgens and depression is well established in adults, the effects of cofactors on this association are less clearly understood, particularly in youth. Epidemiological cohort study of adolescents in Dresden, Germany. Analyses comprised data of 985 individuals assessed at baseline and of 512 individuals at 1-year follow-up. We investigated multivariable regression models for cross-sectional and longitudinal associations of hair testosterone, dehydroepiandrosterone (DHEA), and their cortisol ratios with 12-month diagnoses of major depressive disorder (MDD) and MDD without any anxiety disorder assessed with standardized diagnostic interview (DIA-X-5), and with dimensional depression scores (PHQ-9, PROMIS), separately for males and females. The potential moderating effect of social support was determined. Cross-sectional analyses yielded inverse associations of testosterone and DHEA with MDD and MDD without any anxiety disorders in males. In cross-sectional and longitudinal analyses, baseline ratio cortisol/DHEA was significantly, inversely associated to PROMIS-depression in males. Only cross-sectional associations for ratio cortisol/DHEA and PROMIS-depression remained significant after Bonferroni-Holm correction. No robust associations were observed in female participants. Social support exerted no consistent moderating effect on the investigated association. The present observational cohort study showed no consistent association of hair androgen concentrations with depressive disorders in adolescents. However, findings provide some support for the association between the cortisol/DHEA ratio and depression in males. Longitudinal research designs in large samples are needed to understand the interplay between androgens, depression, and developmental and social factors in youth.Supplementary InformationThe online version contains supplementary material available at 10.1007/s00787-021-01929-w.