The objective of this study was to determine the effects of age, sex, and type of surgery on postoperative pain trajectories derived in a clinical setting from pain assessments in the first 24 hours after surgery. This study is a retrospective cohort study using a large electronic medical records (EMR) system to collect and analyze surgical case data. The sample population included adult patients undergoing non-ambulatory, non-obstetric surgery in a single institution over a 1-year period. Analyses of postoperative pain trajectories were performed using a linear mixed effects model. Pain score observations (91,708) from 7,293 patients were included in the statistical analysis. On average, the pain score decreased about 0.042 [95% CI: (−0.044, −0.040)] points on the numerical rating scale (NRS) per hour following surgery for the first 24 postoperative hours. The pain score reported by male patients was about 0.27 [95% CI: (−0.380, −0.168)] NRS points lower than that reported by females. Pain scores significantly decreased over time in all age groups, with a slightly more rapid decrease for younger patients. Pain trajectories differed by anatomic location of surgery, ranging from −0.054 [95% CI: (−0.062, −0.046)] NRS units per hour for integumentary and nervous surgery to −0.104 [95% CI: (−0.110, −0.098)] NRS units per hour for digestive surgery, and a positive trajectory (0.02 [95% CI: (0.016, 0.024)] NRS units per hour) for musculoskeletal surgery. Our data support the important role of time after surgery in considering the influence of biopsychosocial and clinical factors on acute postoperative pain.