Are there people who gained weight after joining a Gym?
Yes! It happens and it will happen even if you leave say, aerobics or dance or jogging, in fact any physical activity done on regular basis.
Your body didn't gain weight in a single day, it certainly won't lose it in a day. It takes months of following a workout and diet regimen.
Now you're following a proper diet and exercising hard, burning that nasty fat for months, your body gets used to that routine.
What's happens when you leave gym after you feel you've lost enough weight or developed the kind of body you wanted, your body craves for the same routine. Your metabolism has increased, you're burning fat at a much faster rate now and you go back to eating the same junk or even normal food (not the same diet that you were taking while gymming) which is fatier.
What happens next, you burn fat faster => you're hungry often => you eat more but are not exercising enough to burn that fat => In another month or two, you're gaining at a much faster pace.
What to do now? Firstly, don't leave/quit gym in a go. Give your body some time to adjust to the same lifestyle you had before you started to gym. Excercise a little less rigorously, start eating normal food in addition to the diet, shift to a different workout like jogging and as you decrease your time at gym, increase your time spent jogging. Do the same with diet and Voila, you will not gain weight or gain very less hafte leaving gym.