City Jail is where you go when you get caught by the police committing a crime. Going to jail by failing a Crime causes you to lose crime experience. When in the city jail, you will also not be able to visit the City, your homepage or the Hospital, other things such as your Faction and mailbox are still open though.
The following thing will land you in jail:
You can bust yourself out of jail if your jail-time is below 200 minutes, it will cost you up to half your (full) nerve bar. Busting yourself out no longer gives a dexterity stat boost.