Exercising provides benefits to the immune system by helping prevent colds and flu, but excessive exercise can weaken the immune system. Moderate exercise of 60-90 minutes 4-5 days a week is optimal, while over-exercising like intensive workouts for marathon training can cause stress hormones to rise and suppress the immune system. It's important to listen to your body and allow for adequate rest between workouts to let the immune system recover.