The study analyzed the effect of daily temperature on hospitalizations for pulmonary hypertension (PH) in Shanghai during 2013–2023 using a distributed nonlinear model with a lag of up to 30 days. A total of 12,218 hospitalizations for PH were recorded. They observed a non-linear U-shaped relationship between average daily temperature and risk of hospitalization, with extreme cold (4.6°C, 5th percentile) and mild cold (10.4°C, 25th percentile) significantly increasing risk, unlike extremes of heat. The reference temperature was 18 °C; the strongest single-day effect of extreme cold was at a lag of 3 days (RR: 1.05, 95% CI: 1.01–1.10), and the cumulative effect of 0–30 days reached RR: 2.80 (95% CI: 1.59). The attributable fractions of hospitalizations were 8% for extreme cold and 26% for mild cold. Stratified analyzes showed higher susceptibility among women, individuals younger than 65 years, and those without health insurance. The study confirms that cold significantly increases the risk of hospitalization for PH.