If you don't want to be a member of a group chat anymore, you can leave the chat. You can always re-join the chat later if you change your mind.
Once you leave, a note appears in the group chat's message history letting other members know that you left the chat. You will still be able to view the group chat messages that were sent before you left.
If someone keeps adding you to group chats you don't want to be in, consider changing who can invite you to group chats or blocking that person.