Should i join gym???

I want to join a gym but am holding back waht if i later on stop going gym d put on weight again??? Is it tru tat once u joined gym thn either u hav to continue it for lifelong or u will put on more weight thn before once u stop it. Can anyone help???