Was there an area on these boats that could be used for a jail?
There was no such place on an operating submarine. There was rarely a need for one and, if there were, it wouldn’t usually be for the crew. Offenses that were serious enough to warrant physical confinement rarely, if ever, happened on a submarine during WW2. Besides, how could you physically punish someone worse than putting him on a submarine in combat – where he already was?
However, there was an occasional need to confine someone. That would usually be Japanese POWs, although that didn’t happen very often. Japanese soldiers and sailors would usually swim away from a rescue. It was dishonorable to be captured. The few that were taken aboard, for intelligence purposes, would just be handcuffed to a bunk. Sometimes, the captured POW would want to contribute to the boat by helping with the cleaning. If the captain and crew believed that the POW was reliable enough, they could remove the handcuffs and let him help.
The assumption would be that if a crewmember needed to be confined, it would be easy enough to cuff him to a bunk for the rest of the patrol.