ImportanceExcessive screen time has been associated with a higher risk for mental health problems, but whether the associations differ by screen content types is unclear.ObjectiveTo examine the allocation of and longitudinal changes in screen exposure across different content types and to explore their associations with mental health in children aged 3 to 6 years.Design, Setting, and ParticipantsThis cohort study used 3-wave, lagged generalized estimating equation models to analyze data from the Shanghai Children’s Health, Education and Lifestyle Evaluation–Preschool (SCHEDULE-P) study in Shanghai, China. The cohort was a representative sample of kindergarten children. Data were collected between November 2016 and May 2019 when children were aged 3 to 4 years (wave 1), 4 to 5 years (wave 2), and 5 to 6 years (wave 3). Data analysis was performed between June 2022 and May 2023.ExposureScreen exposure (total daily time and time with each type of content, including educational programs, entertainment programs, non–child-directed programs, electronic games, and social media) was collected when children were aged 3, 5, and 6 years.Main Outcomes and MeasuresMental health of children at age 3, 5, and 6 years was reported by parents using the Strengths and Difficulties Questionnaire.ResultsOf the 15 965 children included in the representative sample, 8270 were males (51.7%) and the mean (SD) age at wave 1 was 3.73 (0.30) years. As children developed from ages 3 to 6 years, the proportion of screen exposure to educational programs (≤1 hour per day: 45.0% [95% CI, 43.5%-46.5%] to 26.8% [95% CI, 25.3%-28.3%]) and entertainment programs (≤1 hour per day: 44.4% [95% CI, 42.8%-45.9%] to 32.1% [95% CI, 30.4%-33.9%]) decreased, whereas exposure to social media increased (≤1 hour per day: 1.5% [95% CI, 1.2%-1.9%] to 27.1% [95% CI, 25.5%-28.7%]). The associations between on-screen content and mental health varied. For a given total screen time, a higher proportion of screen exposure to educational programs was associated with a lower risk for mental health problems (adjusted odds ratio [AOR], 0.73; 95% CI, 0.60-0.90), whereas non–child-directed programs were associated with a higher risk for such problems (AOR, 2.82; 95% CI, 1.91-4.18). Regardless of the content, total screen time was consistently associated with mental health problems.Conclusions and relevanceResults of this study indicated that both total screen time and different types of content were associated with mental health problems in children aged 3 to 6 years. Limiting children’s screen time, prioritizing educational programs, and avoiding non–child-directed programs are recommended.