Examine the association between prior SARS-CoV-2 infection, interval from infection to surgery, and adverse surgical outcomes. Earlier series have reported worse outcomes for surgery after COVID-19 illness, and these findings have led to routinely deferring surgery seven weeks after infection. We created a retrospective cohort of patients from the US Veterans Health Administration facilities nationwide, April 2020 to September 2022, undergoing surgical procedures. Primary outcomes were 90-day all-cause mortality and 30-day complications. Within surgical procedure groupings, SARS-CoV-2 infected and uninfected patients were matched in a 1:4 ratio. We categorized patients by 2-week intervals from SARS-CoV-2 positive test to surgery. Hierarchical multilevel multivariable logistic regression models were used to estimate the association between infection to surgery interval versus no infection and primary end points. We identified 82,815 veterans undergoing eligible operations (33% general, 27% orthopedic, 13% urologic, 9% vascular), of whom 16,563 (20%) had laboratory-confirmed SARS-CoV-2 infection before surgery. The multivariable models demonstrated an association between prior SARS-CoV-2 infection and increased 90-day mortality (odds ratio (OR) 1.42, 95% CI: 1.08, 1.86) and complications (OR 1.32, 95% CI: 1.11, 1.57) only for patients having surgery within 14 days of infection. ASA-stratified multivariable models showed that the associations between increased 90-day mortality (OR 1.40, 95% CI: 1.12, 1.75) and complications (OR 1.73, 95% CI: 1.34, 2.24) for patients having surgery within 14 days of infection were confined to those with ASA 4-5. In a contemporary surgical cohort, patients with prior SARS-CoV-2 infection only had increased postoperative mortality or complications when they had surgery within 14 days after the positive test. These findings support revising timing recommendations between surgery and prior SARS-CoV-2 infection.