Objectives Multiple mechanisms may be involved in postoperative atrial fibrillation. Therefore, our objective was to determine the risk factors for postoperative atrial fibrillation as a function of time after coronary artery bypass grafting or valve surgeries to determine which risk factors might predominate at different times. Methods Parametric hazard functions were determined for 1583 patients and then in subgroups (coronary artery bypass grafting alone, mitral valve procedure, and aortic valve replacement +/-coronary artery bypass grafting). Multivariable risk factor analyses were performed, and the risk for postoperative atrial fibrillation was estimated. Results The risk for postoperative atrial fibrillation for all patients was highest immediately postoperatively and at 48 hours. The initial peak risk declined to approximately zero within 18 hours postoperatively. A second peak occurred at 48 hours, followed by a slow decline over the following 4 to 7 days. The time intervals encompassing these peaks were termed phase I and phase II. Predominant risk factors in phase I were older age (relative risk [RR], 1.6; P =.006), longer crossclamp time (RR, 1.3; P =.001), and mitral valve procedure (RR, 2.5; P =.0001). In phase II, these were older age (RR, 3.0; P <.0001), greater weight (RR, 1.6; P <.0001), and Caucasian race (RR, 2.5; P =.006). For patients receiving a mitral valve procedure, the risk for postoperative atrial fibrillation in phase II was higher and remained elevated for as long as 9 days postoperatively in comparison with isolated coronary artery bypass grafting, for which the risk returned to near baseline by postoperative day 6. Conclusions Phase I and phase II periods are associated with distinct risk factors; therefore, it is likely that the mechanisms of postoperative atrial fibrillation change over time.