Physically, 6 weeks
Assuming no complications, patients can be discharged within a few days after surgery.
The surgical wounds
heal within a couple of weeks. If a sternotomy was used, the bones may not be at full strength until about 6 weeks. Soreness with range of motion may persist a bit after that, but cardiac & physical rehabilitation will sort all of that out. Complications obviously may add time to healing.