Parent-adolescent relationships and school connectedness are critical promotive factors for adolescent self-compassion. However, little is known about how the magnitude of the associations between these protective factors and self-compassion changes across continuous age groups and whether gender differences exist in the age-varying associations. This study aims to investigate (1) the age-varying associations of parent-adolescent relationships and school connectedness with self-compassion using time-varying effect modeling and (2) how their age-varying associations may differ by gender. A total of 14,776 adolescents aged 10-18 (mean age = 13.53 ± 2.08, 52.3% males) from Shenzhen, China participated in this study. All adolescents completed the online questionnaires in the school computer rooms. The results showed that both parent-adolescent relationships and school connectedness were positively associated with adolescent self-compassion, and the magnitudes fluctuated with age. Specifically, the association between parent-adolescent relationships and self-compassion peaked for adolescents in early adolescence, with the key timing for girls (age group of 10 years old) being slightly earlier than boys (age group of 11 years old). The association between school connectedness and self-compassion was stronger for boys in the early years of adolescence (in the age group of 12.7 years), while stronger for girls during middle adolescence (in the age group of 14.0 years). Overall, girls were more sensitive to connections with parents and schools than boys during most age groups. The findings demonstrated differential key timing for boys and girls regarding family- and school-based intervention to cultivate self-compassion and highlighted the importance of maintaining strong connections with families and schools for cultivating adolescent self-compassion, particularly for girls.