There isn't a clearcut answer. Someone in the group has to be the quietest person (which may or may not work for your personality), but it is important that the group is still able to pay attention when appropriate. If you have something of extra value to contribute to a conversation (it may be a topic or field you have more education or experience with than the rest of the group), and you are interrupted or broadly ignored in favor of what other people have to say, I think you want to leave due to a lack of respect.
You may also find you want to talk to people in smaller groups or on an individual basis, so you might see if it is possible to group off in that way. Even if you are in a larger group, you might be able to address someone individually (especially if you have something to say that is relevant specifically to the individual) while another conversation is going on.
Sometimes you just have to bide your time, but a part of conversation is paying attention to the conversation -- if it is something interesting, you will probably find an opportunity to engage at some point, but if it is something you have a low connection to and a low interest in, it is easier to just leave than to redirect the conversation to something you find more relatable. Take your chances with another group.