Previous evidence on heatwaves’ impact on mental health outpatient visits is limited, especially uncertainty on how different heatwave definitions affect this relationship. In this time‐series study, we assessed the association between heatwaves and outpatient visits for mental disorders in Guangzhou, China. Daily outpatient visits for mental disorders and its specific categories (schizophrenia, mood, and neurotic disorders) were sourced from the Urban Resident‐based Basic Medical Insurance (URBMI) and the Urban Employee‐based Basic Medical Insurance (UEBMI) claims databases in Guangzhou from 2010 to 2014. The study employed nine heatwave definitions, based on combinations of three daily mean temperature thresholds (90th, 92.5th, and 95th percentiles) and durations (2, 3, and 4 days). Using quasi‐Poisson generalized linear models (GLMs), we estimated the risks (at lag 0 day) and cumulative effects (lag 0–10 days) of heatwaves on mental disorder outpatient visits. Age, gender, types of medical insurance were considered as potential effect modifiers. We observed a positive association between heatwaves and increased total outpatient visits for mental disorders, both at lag 0 day and during lag 0–10 days. The impact of heatwave was significant at lag 0 day for schizophrenia, mood and neurotic disorders visits, it remained significant for neurotic and mood disorders visits during lag 0–10 days. Heatwave durations lasting more than 4 days were associated with higher relative risks of mental disorders at lag 0 day. Older adults had relatively higher effect estimations than younger individuals. This research highlights the effects of extreme heat on mental health.