Open WhatsApp on your phone, and go to Settings > Accounts > Privacy.

Tap on Groups, and select the option that suits you best. The first one will prompt the user adding you to first send an invitation that you can approve: – Nobody (this prevents anyone from adding you to a group without an invitation)