It depends on a couple factors. First, it depends on what type of surgery you had. A micro-discectomy, for example, heals faster and involves less recovery time than a fusion surgery.
Second, it depends on how stressful your sports activities are. No matter what you do, you will need to work up to your activities gradually and gently. You don't want to re-injure your spine. Follow your rehabilitation plan carefully. Your doctor or therapist has recommended it to give you the best chance of making a full recovery.