Air quality is one of the problems cities face today. The COVID-19 pandemic provided a unique opportunity to study the influence of traffic reduction on air quality during 2020, 2021, and 2022. The aim of this paper is to analyze the impacts and relationship between mobility restrictions in six COVID-19 wave periods and air pollution and evolution in the post-pandemic period differentiating Madrid city from its metropolitan area. We tested whether the changes produced for NO2, NOx, PM2.5, PM10, and O3 in the urban traffic and suburban traffic air quality stations data in comparison to the 2019 reference period were significant. The findings of this study show that the periods with the greatest reduction in pollutant concentrations were the first and third COVID-19 waves, when mobility restrictions were most stringent: there was strict confinement for the first wave (i.e., 47% reduction in daily average NO2 concentration), while severe weather forced a reduction in traffic in the region in the third wave period (i.e., 41% reduction in daily average NOx concentration). With the return to normal activity in the last period, pollutant concentrations began to exceed pre-pandemic levels. At the urban level, the reductions were more noticeable in relation to NO2 and NOx, while at the suburban level, changes were less prominent, except for the O3. The results are particularly inspiring for designing future mobility strategies for improving air quality in urban and metropolitan areas.