According to the U.S. Department of Health and Human Services, an adult needs a minimum of 150 minutes of moderately intense activity per week. As long as this minimum is met, it does not matter whether it takes place in two sessions, five sessions or seven sessions.
It is difficult to give a precise recommendation of how many times to go to the gym per week, since the real measurement that matters is how much time a person spends exercising. To hit the U.S. Department of Health and Human Services' 150-minute minimum, a person can choose two 75-minute elliptical sessions per week, five 30-minute exercise bike sessions per week or anything in between.
However, there are also significant benefits to visiting the gym frequently. As the National Institutes of Health notes, the more often a person goes to the gym, the more motivated that person is to continue the gym habit. If a person only goes to the gym once a week, it does not feel like a habit, even if the person exercises for the full recommended 150 minutes. Going to the gym three, four or five times per week cements the habit, increases the possibility that a person then exercises above and beyond the recommended 150-minute minimum and contributes significantly to overall health.