Fat gain is caused by daily intake exceeding consumption, and has nothing to do with going to the gym. Of course, many people will get fat after they stop exercising, because people are often hungry after exercising, so if they eat too much, they will be exhausted after practicing every day. If they don't practice, they will get fat because they eat too much and habitually eat too much.
But you don't have to worry, because your body can't do this without a certain amount of continuous exercise. If you go with friends, you won't practice like an athlete, so you won't get fat if you keep a normal diet.