How long do you have to exercise to stay fit?

Depends. Usually would need to do aerobic exercise 3 to 4 days per week for a minimum average of 30 min per session. Having at least one session per week with intervals of increased intensity will help. Also try to have one session being a bit longer (40-60 min). Varying intensity and duration would help to maintain fitness better as the body easily adjusts to the "sameness" of routine so mix it up.
20 - 30 mins/day. The predominant rule of thumb is 20 -30 minutes per day , 3 - 5 days per week. Of course, it all depends upon the exercise, the intensity, your metabolism, and your diet. This is a minimum.
20-40 minutes/daily . Fitness can be achieved through (1) vigorous and consistent exercise, 5-6 days/week. However, this is only one component of "fitness." the others are (2) right nutrition to fuel the body's organs, muscles, nerves and bones as they they adapt and grow; (3) adequate rem sleep; and (4) recovery through elimination of stress improved mental clarity and focus.;.