Parental warmth plays an important role in the development of adolescents’ physical and mental health. There are numerous empirical studies indicating a relationship between parental warmth and prosocial behavior among adolescents, although the underlying mechanisms of this association remain unclear. Adopting a longitudinal design across two time points, the present study proposes a moderated mediation model to explore the mediating role of gratitude and the moderating role of the school climate between parental warmth and prosocial behavior. The sample consisted of 943 participants (483 boys and 451 girls) who participated in the second assessment and completed questionnaires assessing gratitude, school climate, and prosocial behavior in April 2019. Their parents participated in the first assessment and completed a questionnaire pertaining to parental warmth in October 2018. After controlling for the gender and age of the adolescents, the results showed that the positive association between parental warmth and prosocial behavior is mediated by gratitude, and school climate does play a moderating role in the second half of the mediating path. Specifically, the school climate can play a protective role in adolescents with low levels of gratitude. For adolescents with less gratitude, a strong school climate can promote more prosocial behaviors and can effectively alleviate the negative prediction of low levels of gratitude. This study provides a theoretical explanation for the generation of adolescents’ prosocial behavior, and provides theoretical guidance for the interventions of schools and parents.