Many studies have reported poor mental health coinciding with lockdowns and experiences of the COVID-19 pandemic. The harshest lockdowns tended to happen in cities, and yet differing urban forms are likely to have mediated their effects. South Africa, characterised by varying urban forms, had high levels of poor mental health pre-pandemic, and yet experienced one of the toughest lockdowns. We explored the differences in the prevalence of, and the factors associated with, self-reported changes in mental health, in socio-economically complex and heterogenous urban areas in South Africa, to understand how urban form may have mediated the effects of the pandemic. We specifically looked at Atteridgeville, an old formal township; Melusi, a newer, and less dense informal settlement; and Hillbrow, a long-standing and deteriorating high-rise high-density formal area in central Johannesburg. We used cross-sectional data from 1332 respondents who participated in GRT-INSPIRED’s face-to-face interviews from March to October 2021. Weighted logistic regression models were used to determine the relationships between socioeconomic and demographic variables with self-reported mental health during the pandemic. We found that being from Melusi, the informal location, as compared to being from Hillbrow, the inner-city location, was associated with increased odds of worsening mental health during the pandemic. It was also only in Melusi where receiving a government grant had a protective effect against worsening mental health. Interestingly, we also found that the factors that are associated with worsening mental health are not the inverse of the factors that improve mental health. The differences in the effects of explanatory variables by location suggest that the effects of COVID-19 on mental health may have been mediated through urban form as well as socioeconomic factors such as social networks. This study provided both the factors that can be targeted to prevent poor mental health and to sustain good mental health.