Prison is an unavoidable part of the criminal life in GangCity. The more often, and the heavier, you commit crimes, the greater the chance you get caught. Behind bars you temporarily can't perform any actions — unless you manage to escape.
Every crime carries a chance of getting caught. If an attempt fails, you end up in a cell for a set amount of time. Heavier crimes pay out more, but the chance of getting caught is correspondingly higher. That's the constant trade-off in GangCity: more risk for more reward.
You don't just have to sit out your sentence. You can try to break yourself out, with a success chance that depends on luck and your situation. If it works, you're immediately free again to commit crimes.
But breaking out is also a social activity: you can free fellow gangsters and family members who are locked up. This is one of the reasons allies are so valuable — a good friend gets you out before you lose too much playtime.
Don't think of prison as a punishment, but as a game element. Escaping is a skill you learn to master, and freeing others builds trust and reputation. Prison stops no one who truly wants out.