Air pollution has become one of the major environmental concerns to academia and urban residents. As a key megacity city of the "Silk Road Economic Belt", Urumqi has been listed as one of the ten most polluted cities in the world, posing a serious threat to the urban environment and residents' health. Therefore, the assessment of air pollution and its health impact on urban residents is urgently required for promoting the sustainable development of the city. This study analyzed the temporal and spatial changes in the concentration of major air pollutants in Urumqi and its response to epidemic prevention and control measures based on the data of PM2.5, PM10, SO2, NO2, CO, and O3_8h from 10 air quality monitoring stations in Urumqi from January 1, 2017, to December 31, 2021, mainly focusing on the temporal and spatial variation characteristics of PM2.5 and O3_8h concentrations, changes in pollution levels and their potential risks on human health. The results showed that the concentrations of air pollutants PM2.5, PM10, SO2, NO2, CO, and O3_8h at various air quality monitoring sites from 2017 to 2021 showed a cyclical trend, and the implementation of the government's strict COVID-19 prevention and control measures had a significant effect on the reduction of air pollutant concentrations. The mean value of ρ(PM2.5) decreased from 2017 to 2021, while ρ(O3_8h) showed a waveform change trend (increased in 2017–2018, decreased in 2018–2020, and increased after 2020 ). In terms of the distribution area, the variation of ρ(PM2.5) and ρ(O3_8h) were greater in industrial areas than in commercial and residential areas. Continuous wavelet coherence exists between AQI and PM2.5 and O3_8h at each site during the period from January 2018 to December 2020, and AQI and PM2.5 were positively correlated. The high pollution levels (grades IV and V) of air pollutants PM2.5 and O3_8h in Urumqi decreased year by year, indicating that the number of days with potential threats to residents' health is gradually decreasing. Therefore, more attention should be paid to the control and governance of air pollution in Urumqi.