Psychiatric patients have become the focus of public attention, and current research suggests a possible link between Toxoplasma gondii (T. gondii) infection and mental illness. To understand the current situation of T. gondii infection in psychiatric patients in the study area, the relationship between T. gondii infection and mental diseases, and the influence of T. gondii infection on psychiatric patients, this study examined 3101 psychiatric inpatients from 2015 to 2020. All people included in the study were tested for anti-Toxoplasma IgM antibody and anti-Toxoplasma IgG antibody. Additionally, 4040 individuals from the general population were included as controls. The chi-square test and logistic regression analysis were carried out to determine the association between psychiatric disorders and T. gondii infection. The seroprevalence of anti-Toxoplasma IgM antibody was 0.23% (7/3101) in psychiatric inpatients and 0.11% (2/1846) in the general population, and there was no significant difference (p > 0.05). The seroprevalence rate of anti-Toxoplasma IgG antibodies was 3.03% (94/3101) in psychiatric inpatients and 1.05% (23/2194) in the general population, and there was a significant difference (p < 0.01). The seroprevalence of anti-Toxoplasma IgG antibody in psychiatric inpatients was significantly different between different age groups (p < 0.01). The positivity rate of anti-Toxoplasma IgG antibodies was 5.17% (3/58) in patients with mania, 3.24% (8/247) in patients with recurrent depressive disorder, 3.54% (13/367) in patients with depression, 3.22% (39/1213) in patients with schizophrenia, 2.41% (18/748) in patients with bipolar disorder and 2.25% (2/89) in patients with dissociative disorder. Compared to the general population, patients with mania (OR = 5.149 95% CI 1.501–17.659 p = 0.009), schizophrenia (OR = 3.136 95% CI 1.864–5.275 p = 0.000), depression (OR = 3.466 95% CI 1.740–6.906 p = 0.000), recurrent depressive disorder (OR = 3.160 95% CI 1.398–7.142 p = 0.006) and bipolar disorder (OR = 2.327 95% CI 1.249–4.337 p = 0.008) were found to be significantly associated with the seroprevalence of anti-Toxoplasma IgG antibody. This study suggests that the seroprevalence of T. gondii infection in psychiatric patients was higher and that age was an influencing factor of T. gondii infection in psychiatric patients. T. gondii infection was associated with mania, schizophrenia, depression, recurrent depressive disorder and bipolar disorder.