This study investigates students' social networks and mental health before and at the time of the COVID-19 pandemic in April 2020, using longitudinal data collected since 2018. We analyze change on multiple dimensions of social networks (interaction, friendship, social support, co-studying) and mental health indicators (depression, anxiety, stress, loneliness) within two cohorts of Swiss undergraduate students experiencing the crisis (N = 212), and make additional comparisons to an earlier cohort which did not experience the crisis (N = 54). In within-person comparisons we find that interaction and co-studying networks had become sparser, and more students were studying alone. Furthermore, students' levels of stress, anxiety, loneliness, and depressive symptoms got worse, compared to measures before the crisis. Stressors shifted from fears of missing out on social life to worries about health, family, friends, and their future. Exploratory analyses suggest that COVID-19 specific worries, isolation in social networks, lack of interaction and emotional support, and physical isolation were associated with negative mental health trajectories. Female students appeared to have worse mental health trajectories when controlling for different levels of social integration and COVID-19 related stressors. As universities and researchers discuss future strategies on how to combine on-site teaching with online courses, our results indicate the importance of considering social contacts in students' mental health and offer starting points to identify and support students at higher risk of social isolation and negative psychological effects during the COVID-19 pandemic.