Objective: The aim of this study is to estimate the risk of a new mental health diagnosis within the first 24 months postpartum among women with common pregnancy conditions, overall and by rurality. Materials and Methods: This longitudinal population-based study used the Maine Health Data Organization's All-Payer Claims Data to estimate the cumulative risk of a new mental health disorder diagnosis in the first 24 months postpartum among women with deliveries during 2007-2019 and who did not have a mental health diagnosis before pregnancy. Cox models were used to estimate hazard ratios for common pregnancy conditions (prenatal depression, gestational diabetes [GDM], and hypertensive disorders of pregnancy [HDP]) on the new diagnosis of five mental health conditions, separately. Models were adjusted for maternal demographics and pregnancy characteristics. Results: Of the 123,125 deliveries, the cumulative risk of being diagnosed in the first 24 months postpartum with depression was 28%, anxiety 25%, bipolar disorder 3%, post-traumatic stress disorder 6%, and schizophrenia/psychotic disorder 1%. Women with prenatal depression were at higher risk of having a postpartum mental health diagnosis compared with women without prenatal depression (adjusted hazard ratios [aHRs] ranged from 2.5 [for anxiety] to 4.1 [for postpartum depression]). Risk of having postpartum depression was modestly higher among women with HDP, as was the risk of postpartum bipolar disorder among those with GDM. Findings were generally similar between women living in rural versus urban areas. Conclusions: Effective interventions to prevent, screen, and treat mental health conditions among women with pregnancy complications for an extended time postpartum are warranted.