The Bikini Bottom Police Department (BBPD) is the main law enforcement entity in Bikini Bottom. This includes officers, wardens, prison guards, SWAT Team, and riot guards. They keep the streets clean from crime in Bikini Bottom similar to actual police officers. They first appeared as officers in the episode "Hall Monitor," asking Patrick if he had seen SpongeBob, or "the Maniac". The Prison Warden appeared in "The Inmates of Summer," when he was working at Inferno Island along with Barney the Prison Guard. The SWAT team was seen in "The Thing," where they appeared to handle Smelly (Squidward), after attempting to attack Patrick. The prison guards appeared in "Doing Time" when Mrs. Puff was constantly calling them to come and get SpongeBob and Patrick when they were trying to get her to make a jail-break. It should be noted that some cops have been shown to be rather dimwitted. (e.g. In "Keep Bikini Bottom Beautiful," one officer kept assuming that Squidward was littering while it was clearly the other citizens). SWAT team has also takes care of the transportation for the Krabby Patty secret sauce.
The Bikini Bottom Police Department has established multiple locations to base their operations, as well as places to contain offenders of the law. However, in many cases, it is unreasonably stricter than in real life.
The station is where the cops stay and receive calls for crimes, which is seen in Life of Crime. They have a dispatcher unit somewhere in Bikini Bottom as well.
Bikini Bottom Prison
It is revealed in The SpongeBob SquarePants Movie that they have a prison for tiny criminals such as Plankton, in which he was taken to at the end of the movie.
The jail holds the regular criminals, for simple crimes such as littering, as the The Tattle-Tale Strangler had to stay for littering outside of the Krusty Krab. It holds major criminals as well, such as Plankton for trying to steal the Krabby Patty Formula, in which he has a pad-locked cell, which he easily breaks out of (as seen in Krabby Road).
Inferno Island is a high security prison, located in the middle of a body of water. The only way to get to it is to go there from the dock-yard, on a metal boat, to make sure there are no possible ways for prisoners to escape and swim to shore. The island is very harsh and the prisoners must sleep on hard beds with flat pillows. Inferno Island is much like Alcatraz Island, a prison island from the early 1900's that was strangely abandoned. Alcatraz was near land, had jagged rocks around it, and prisoners were transported to it by boat, the beds were hard, there were watch towers, much like Inferno Island.
Life of Crime - Turned himself and Patrick in, but was relased within a few seconds.
Doing Time - Arrested in one of Mrs. Puff's dream sequences.
Party Pooper Pants - Arrested apparently because he didn't invite the police to his party (possibly making them believe his party was illegal), and spent a night in a police office. The initial reason was for attempting to break into his own house.
Driven to Tears - Turned himself in to save Patrick from being arrested for a crime he didn't commit.
Keep Bikini Bottom Beautiful - Given a ticket for littering (by building a statue made out of garbage) at the end of the episode, along with Squidward.
Bossy Boots - Given a ticket for stripping himself naked in public.
Good Ol' Whatshisname - Arrested for stealing a wallet and resisting arrest, as well as sprinting through a stop sign to escape with the wallet. He wasn't pulled over for committing an actual traffic violation until Boating Buddies.
Patty Caper - Arrested for, ironically, stealing the secret formula (to avoid paying).
Growth Spout - Cited for attempting to steal Mrs. Puff's peanut worms from her garden thinking they were peanuts he was going to take to his overly hungry daughter Pearl (she was having, hence the title, a "growth spout"), but he was never seen being arrested.
The Wreck of the Mauna Loa - Arrested for posing a danger to public safety by nearly killing everyone with the unsafe amusement park ride.
Goo Goo Gas - Arrested for turning Mr. Krabs into a baby.
Krabby Road - Arrested for trying to steal the Krabby Patty Secret formula, then for breaking out of jail to steal it again.
Sweet and Sour Squid - Arrested when the police saw him running around with Squidward's clairinet and assumed he was the one causing the "Musical disturbance" that many Bikini Bottom citizens have complained about when it was Squidward. When he was put in the police boat, he exclaimed "Karen!!! Help!!!". Strangley, the policeman tilted Plankton's head forward and said "Watch your head" when Plankton had plenty of room fitting in the car due to his small stature.
Fiasco! - Arrested for stealing a piece of famous artwork.
Jailbreak! - originally arrested for an unknown reason and at the end arrested for escaping prison/trying to steal the formula.
Oral Report - Arrested due to the fact her student, SpongeBob, was out of control and was under her responsibility.
Patrick-Man! - Arrested for attempted for stealing a boat. This is false because Patrick Man thought she was trying to steal the boat (when she was actually trying to help the man get out of the boat) but she was charged with a felony anyway.
Bumper to Bumper - Arrested for crossing the county line thus violating her parole.