This is an issue that you are going to have to discuss directly with your cardiologist
For example, if you have recently had a heart attach or have heart disease and your surgery
was a bypass surgery, then rehabilitation of the heart is usually build right into your plan from the start. Often you will begin with supervised physical therapy while still in the hospital, and you may need to continue this at a rehab facility prior to going home. In some cases, after seeing your cardiologist upon discharge, you may be referred to a cardiac rehab program, which is an intensive program which combines physical therapy and physical rehab services with counseling and education on diet, exercise, and other heart-healthy habits.
On the other hand if you do not have heart disease or if your operation was not related to your heart, then your personal surgeon will have to give you recommendation on what kinds of exercises or what kind of rehab program they want you to do.