This study aims to investigate the relationship between CPB factors and changes in TH levels in postoperative patients and the effect of oral levothyroxine sodium tablets on outcomes in patients with postoperative TF abnormalities. Select patients who underwent CHD surgery between September 2017 and September 2023 and were aged 13 years or younger. The relationship between CPB and postoperative TF changes and the influencing factors were analyzed. In addition, patients with different diseases and ages were divided into the medication group and the non-medication group. The primary outcome was postoperative ejection fraction (EF), and the secondary outcomes were PICU hospitalization days and total hospital cost. Seven hundred 53 patients were included. The longer the CPB time and ACC time, the lower the postoperative triiodothyronine (T3) and thyroxin (T4) levels (p < 0.001 and p < 0.001). The longer the CPB time, the more pronounced the postoperative T3 level abnormality (p < 0.001). The longer the CPB time, ACC time, and DHCA time, the more pronounced the postoperative T4 level abnormalities (p < 0.001 and p < 0.001 and p = 0.046). The postoperative EF of patients in the medication group was slightly higher than that of the non-medication group, and the EF before discharge was significantly higher than that of the non-medication group (p = 0.021, p = 0.015, and p = 0.024). Postoperative PICU days in the medication group [3.0 (2.0,7.0) versus4.0 (2.0,10.0), p = 0.020] were shorter than the non-medication group, and the proportion of ≤ 5days was more [154 (66.1%) versus304 (58.5%), p = 0.047]. The total hospitalization cost was slightly lower in the medication group (p < 0.05). The duration of CPB, ACC, and DHCA in the open surgery process for CHD affects patients' thyroid function in the postoperative period. In our study, we found that oral levothyroxine sodium tablets are beneficial to the children's postoperative recovery.