The overuse of opioids for acute pain management has led to an epidemic of persistent opioid use. To determine the proportion of opioid-naive patients who develop persistent opioid use after cardiac surgery and investigate the association between the initial amount of opioids prescribed at discharge and the likelihood of developing new persistent opioid use. This retrospective cohort study used data from a national administrative claims database from January 1, 2004, to December 31, 2016 and included 35 817 patients who underwent coronary artery bypass grafting (CABG) (25 673 [71.7%]) and heart valve (10 144 [28.3%]) procedures. All patients were opioid-naive within 180 days before the index procedure and filled an opioid prescription within 14 days after surgery. Opioid medications after cardiac surgery. The proportion of opioid-naive patients who developed new persistent opioid use within 90 to 180 days after surgery was determined. Oral morphine equivalents (OMEs) were calculated for the first opioid prescription filled after discharge. A multivariable logistic regression with cubic splines was used to analyze the association among the OMEs at discharge and likelihood of developing persistent opioid use. Of the 25 673 patients who underwent CABG, the mean (SD) age for those without (n = 23 064) vs with (n = 2609) persistent opioid use was 62.9 (9.8) years vs 61.6 (9.7) years, respectively, and the number who were men were 18 758 (81.3%) vs 1998 (76.6%). Of the 10 144 patients who underwent heart valve surgery, the mean (SD) age for those without (n = 9343) vs with (n = 821) persistent opioid use was 63.2 (12.4) years vs 61.2 (12.5) years, respectively, and the number who were men were 6378 (68.3%) vs 511 (62.2%). Persistent opioid use is a substantial concern after cardiac surgery and occurred in 2609 patients undergoing CABG (10.2%) and 821 valve surgery patients (8.1%; P = .001). The likelihood for developing persistent opioid use was decreased among heart valve surgery recipients (odds ratio [OR], 0.78; P < .001) and increased for patients who were women; younger; with preoperative congestive heart failure, chronic lung disease, diabetes, kidney failure, chronic pain, and alcoholism; and those taking preoperative benzodiazepines and muscle relaxants (women: OR, 1.15 [95% CI, 1.03-1.26]; younger age: OR, 1.02 [95% CI, 1.01-1.02]; congestive heart failure: OR, 1.17 [95% CI, 1.06-1.30]; chronic lung disease: OR, 1.32 [95% CI, 1.19-1.45]; diabetes: OR, 1.27 [95% CI, 1.15-1.40]; kidney failure: OR, 1.17 [95% CI, 1.00-1.37]; chronic pain: OR, 2.71 [95% CI, 2.10-3.56]; alcoholism: OR, 1.56 [95% CI, 1.23-2.00]; benzodiazepines: OR, 1.71 [95% CI, 1.52-1.91]; muscle relaxants: OR, 1.74 [95% CI, 1.51-2.02]; all P < .001). Furthermore, we found that when patients were prescribed more than approximately 300 mg of OMEs at discharge, they had a significantly increased risk of new persistent opioid use than with lower opioid prescriptions. Opioids are used extensively after cardiothoracic surgery and nearly 1 of 10 patients will continue to use opioids over 90 days after surgery. Furthermore, higher OMEs prescribed at discharge were significantly associated with developing persistent use. Centers must adopt protocols to increase patient education and limit opioid prescriptions after discharge.