It depends on what kind of surgery you had. not all abdominal surgery is created equally. It would depend on if you had open surgery or laparoscopic. Depending on the kind of surgery it could be 3 weeks or more than 3 months. It also depends on what kind of exercise.
Walking is usually allowed right away therefore start walking as soon as possible.