ImportanceComplex biological, socioeconomic, and psychological variables combine to cause mental illnesses, with mounting evidence that early-life experiences are associated with adulthood mental health.ObjectiveTo evaluate whether changing neighborhood income deprivation and residential moves during childhood are associated with the risk of receiving a diagnosis of depression in adulthood.Design, Setting, and ParticipantsThis cohort study included the whole population of 1 096 916 people born in Denmark from January 1, 1982, to December 31, 2003, who resided in the country during their first 15 years of life. Individuals were followed up from 15 years of age until either death, emigration, depression diagnosis, or December 31, 2018. Longitudinal data on residential location was obtained by linking all individuals to the Danish longitudinal population register. Statistical analysis was performed from June 2022 to January 2024.ExposuresExposures included a neighborhood income deprivation index at place of residence for each year from birth to 15 years of age and a mean income deprivation index for the entire childhood (aged ≤15 years). Residential moves were considered by defining “stayers” as individuals who lived in the same data zone during their entire childhood and “movers” as those who did not.Main Outcomes and MeasuresMultilevel survival analysis determined associations between neighborhood-level income deprivation and depression incidence rates after adjustment for individual factors. Results were reported as incidence rate ratios (IRRs) with 95% credible intervals (95% CrIs). The hypotheses were formulated before data collection.ResultsA total of 1 096 916 individuals (563 864 male participants [51.4%]) were followed up from 15 years of age. During follow-up, 35 098 individuals (23 728 female participants [67.6%]) received a diagnosis of depression. People living in deprived areas during childhood had an increased risk of depression (IRR, 1.10 [95% CrI, 1.08-1.12]). After full individual-level adjustment, the risk was attenuated (IRR, 1.02 [95% CrI, 1.01-1.04]), indicating an increase of 2% in depression incidence for each 1-SD increase in income deprivation. Moving during childhood, independent of neighborhood deprivation status, was associated with significantly higher rates of depression in adulthood compared with not moving (IRR, 1.61 [95% CrI, 1.52-1.70] for 2 or more moves after full adjustment).Conclusions and RelevanceThis study suggests that, rather than just high or changing neighborhood income deprivation trajectories in childhood being associated with adulthood depression, a settled home environment in childhood may have a protective association against depression. Policies that enable and support settled childhoods should be promoted.