The number people usually quote is three, but that is a rule of thumb rather than a fixed rule. What actually decides your fate is the severity of what you did.
For something low-level such as spam or a chat filter trip, moderation tends to be forgiving. You can accumulate several short bans and keep your account, because the pattern reads as carelessness rather than malice.
For anything at the severe end, including hate speech, slurs, or uploading inappropriate images, the response is immediate and harsh. A single permanent termination is entirely possible on a first offence. There is no accumulated allowance to draw on in those cases.
The safest approach is unglamorous: follow the community rules and the question never comes up.