If you leave the scheme with less than 2 years pensionable service and have not transferred in a previous pension, you will be entitled to a refund unless you have active (in another post), deferred or pensioner membership. You can alternatively transfer your benefits out.
If you have 2 years pensionable service and leave the scheme, the benefits you've accumulated will be treated as a deferred pension and you will become a deferred member.
A deferred member can transfer their benefits out.
If you leave local government, or move to an employer who's not part of the LGPS, you can't keep paying into the LGPS.