Objective To test the hypothesis that postoperative length of stay (LOS) after infant heart surgery might be an easily measured surrogate marker for various events that culminate in later adverse cognitive outcome. Methods Among 160 eligible patients with D-transposition of the great arteries undergoing reparative surgery in infancy, 155 (97%) were reevaluated at age 8 years with IQ and achievement testing. We explored whether LOS quartiles were associated with these outcomes when adjusting for perioperative and sociodemographic variables. Results Longer cardiac intensive care unit (CICU) LOS quartiles were associated at age 8 years with lower full-scale IQ (P =.02). lower verbal IQ (P =.02), and with tendencies toward lower performance IQ (P =.08) and math achievement (P =.08) in adjusted models. Compared with patients in the first quartile of CICU LOS, those in the fourth quartile had mean scores for full-scale IQ that were lower by 7.2 points (P =.01); verbal IQ, 7.3 points (P =.02); performance IQ, 5.8 points (P =.05): and math achievement, 6.0 points (P =.07). Analyses on hospital LOS quartile were similar. Conclusions Longer postoperative LOS is associated with worse later cognitive function, even when adjusted for perioperative events, perfusion times, and sociodemographic variables. Further research is necessary to determine the mechanisms underlying this relation.