Perception of friendship quality has been shown to be a key ingredient for children’s mental health, however, less is known about how the learning environment might impact these relations. This study investigated how children’s perceptions of friendship quality are related to their mental health (i.e., satisfaction with life and depressive symptoms) and whether school goal structures are potential moderators for these relations in a sample of elementary school children. A sample of 423 fourth-grade students (Mage = 10.85, 46.33% boys) and their teachers (N = 24) participated in the study. Children filled out questionnaires assessing friendship quality, satisfaction with life, and depressive symptoms. Teachers completed a scale evaluating their perception of the school goal structures. Results indicated that children who reported high positive friendship quality were more satisfied with their lives, whereas children who reported high levels of negative friendship quality experienced lower levels of life satisfaction and higher levels of depressive symptoms. School mastery goal structures reported by teachers moderated the relation between children’s perception of friendship quality and their depressive symptoms and life satisfaction. Further, school performance goal structures reported by teachers moderated the relation between children’s perception of negative friendship quality and their depressive symptoms. The results seem to suggest that the effects of mastery goal structure are not always positive, whereas a performance goal structure might sometimes be beneficial for students’ mental health.