It depends on which type of surgery is done. If it is a sternum lift, it will take at least 6 months after the surgery to allow the sternum to grow completely firm before you can exercise normally. However, normal activities such as walking can be done as soon as 1 month after surgery.
If it's a NUSS surgery with plate lifting, you can exercise about 1 month after surgery when the pain subsides. However, for strenuous exercise, it is best to do so 3 months after surgery.