In recent years, psychology and psychotherapy have received particular attention, especially concerning hospitalized patients. Because of the growing number of mental disorders among patients undergoing cardiac surgery, it is necessary to identify factors affecting the mental health of these patients. The purpose of this research was to study the relationship between psychological wellbeing and exercise among patients undergoing cardiac surgery. Methods: In this case-control study, 176 patients with Acute Coronary Syndrome (ACS) and one of their relatives (third-degree relatives) were investigated. The study data were collected through interviews with the patients. The study questionnaire had three parts comprising demographic, clinical, and Ryff standard questionnaires and exercise frequency (the average hours of exercise per day, and the number of days per week). To analyze the variables, the independent samples t-test and multiple linear regression models were used. The significance level was set as <0.05. Results: In each group, 88 subjects were investigated. The results showed no significant difference between the two groups in the positive relationship (P=0.206) and autonomy (P=0.057) subscales. In other subscales and the total score of healthy subjects, the mean score was higher (P< 0.05). Also, there was a significant difference between the two groups in just the autonomy subscale (P=0.038). Furthermore, the increase in the number of exercise days, and especially 1 to 2 hours per day had a positive and significant effect on the total score and the subscale of autonomy. Conclusion: Patients undergoing cardiac surgery should be encouraged to perform the exercise, which in turn improves their aspects of mental health such as psychological wellbeing.