This study conducted short-term longitudinal tracking of 1352 first-semester junior middle school freshmen to understand how lower family socioeconomic status and higher perceived stress affect sleep quality during this "key transition" in schooling. The study used the Pittsburgh Sleep Quality Scale, Chinese Version of the Perceived Stress Scale, and Family Socioeconomic Status Questionnaire, along with a latent variable growth modeling approach, to explore the overall sleep quality development trajectory and its influencing factors for first-semester freshmen. The results showed that junior middle school first-semester freshmen's sleep quality scores in the transition period presented a linear downward trend, and perceived stress hindered the improvement of sleep quality during this period. Moreover, students with low family socioeconomic status experienced greater perceived stress and poorer sleep quality during the transition to junior middle school. These findings are help to understand the processes by which established risk factors, including lower family socioeconomic status and higher perceived stress, impact sleep quality development. Therefore, it is necessary to alleviate the perceived stress of students with lower family socioeconomic status, thereby improving sleep quality in early life and preventing sleep disorders in adulthood.