In the United States, >3.6 million deliveries occur annually. Among them, up to 20% (approximately 700,000) of women experience postpartum depression (PPD) according to the Centers for Disease Control and Prevention. Absence of accurate reporting and diagnosis has made phenotyping of patients with PPD difficult. Existing literature has shown that factors such as race, socioeconomic status, and history of substance abuse are associated with the differential risks of PPD. However, limited research has considered differential temporal associations with the outcome. This study aimed to estimate the disparities in the risk of PPD and time to diagnosis for patients of different racial and socioeconomic backgrounds. This is a longitudinal retrospective study using the statewide hospital discharge data from Maryland. We identified 160,066 individuals who had a hospital delivery from 2017 to 2019. We applied logistic regression and Cox regression to study the risk of PPD across racial and socioeconomic strata. Multinomial regression was used to estimate the risk of PPD at different postpartum stages. The cumulative incidence of PPD diagnosis was highest for White patients (8779/65,028, 13.5%) and lowest for Asian and Pacific Islander patients (248/10,760, 2.3%). Compared with White patients, PPD diagnosis was less likely to occur for Black patients (odds ratio [OR] 0.31, 95% CI 0.30-0.33), Asian or Pacific Islander patients (OR 0.17, 95% CI 0.15-0.19), and Hispanic patients (OR 0.21, 95% CI 0.19-0.22). Similar findings were observed from the Cox regression analysis. Multinomial regression showed that compared with White patients, Black patients (relative risk 2.12, 95% CI 1.73-2.60) and Asian and Pacific Islander patients (relative risk 2.48, 95% CI 1.46-4.21) were more likely to be diagnosed with PPD after 8 weeks of delivery. Compared with White patients, PPD diagnosis is less likely to occur in individuals of other races. We found disparate timing in PPD diagnosis across different racial groups and socioeconomic backgrounds. Our findings serve to enhance intervention strategies and policies for phenotyping patients at the highest risk of PPD and to highlight needs in data quality to support future work on racial disparities in PPD.