ObjectiveShortening the length of hospital stay (LOS) has become a major challenge for psychiatric hospitals in reducing unnecessary costs and improving the patient healthcare experience. We investigated the key factors associated with a long psychiatric hospitalization.MethodThis was a retrospective study of 8,870 full-time psychiatric hospital stays (6,216 patients) in the Paris Psychiatry Hospital Group, with a discharge in 2022. We used machine learning tools and univariate and multivariate methods to explore the impact of demographic, pathway-related, and clinical variables on the LOS.ResultsLOS >30 days was associated with age >55 years {odds ratio [OR] =2 [95% confidence interval 1.7–2.3]}, admission from outside the sectorization zone [OR=1.2 (1.1–1.3)], admission via a psychiatric emergency unit [OR, 1.2 (1.1–1.4)], and some clinical severity markers, such as psychotic disorder diagnosis [OR, 1.5 (1.3–1.7)], mandatory care [request of a third party, OR, 2.5 (2.1–2.9); case of imminent danger, OR, 2.3 (1.9–2.7)], the presence of seclusion and mechanical restraint measures (highlighting the positive effect of restraint duration), the somatic comorbidity for female sex [OR, 1.4 (1.2–1.7)], and treatment resistance [OR, 1.4 (1.2–1.6)]. Conversely, LOS ≤30 days was associated with being in a relationship [OR, 0.6 (0.5–0.8)], admission during a travel-related psychiatric episode [OR, 0.5 (0.3–0.6)], and personality and behavior disorders [OR, 0.7 (0.6–0.9)]. We found no significant association for features such as sex and a lack of treatment compliance.ConclusionTo our knowledge, this is the first recent study to investigate and highlight the impact of factors related to various illness severity markers, medication adherence, and patient journeys on the length of psychiatric hospital stay. A better understanding of long-stay risk factors might be helpful for optimizing the allocation of medical resources and anticipating tailored therapeutic programs.