During the COVID-19 pandemic, Chinese universities implemented many interventions against SAR-CoV-2 transmission. Close contact is thought to be a major transmission route. However, the effect of university closure-related interventions on infection risk amongst students is still poorly understood. In July 2022, we conducted an online survey of 2,400 university students in Beijing and Shanghai. Combined with real human behaviours, we evaluated the infection risk via close contact during both periods of university closures and non-closures. During the non-closure period, undergraduate and postgraduate students spent the longest close contact time in classrooms and graduate student offices, averaging 1.9 h and 2.2 h, respectively. During university closures, students spent the longest close contact time in residences (dormitories and homes), reaching up to 2.8 h. Catering places and residences were the two main indoor environments for viral exposure via close contact. Viral exposure did not differ significantly by education background or gender ( p > 0.05) but did by intervention levels in university or community ( p < 0.05). The infection risk decreased by 30.0% for resident students and 63.6% for non-resident students during university closures. The findings could provide scientific support for intervention policy-making during public health emergencies such as COVID-19 pandemic.