To start, the number of prisoners you can assign to a cell is calculated the volume divided by 12, rounded down. So, for a 5x5 minimum size cell, that's 5x5=25/12=2.0833..., rounded down to 2 prisoners. If you then un-designate two squares from that workshop, you'll instead have 5x5=25-2=23/12=1.9166..., rounded down to 1 prisoner.

What this means is, for every prisoner you want to have in a workshop, you need to designate 12 squares of workshop. If you want a workshop with 8 prisoners, then you need a volume of 8x12=96 squares. An easy way to use this is to simply make your workshop X by 12 squares in size, where X is the number of prisoners you want in it. The shape of the room is irrelevant, though, and you could just as easily have a 1 square wide corridor that's as large as you need, as long as you have a turn somewhere to satisfy the 5x5 minimum size.

The number of prisoners increases in this way consistently up to 20 prisoners, at which point a larger room has no effect. Even with a workshop the size of a small map, you can still only assign 20 workers. This means that the effective limit on the size of a workshop is 240 squares, or a 15x16 square room. You can of course get more workers by making a second workshop, but for a single room this is the limit.

Laundry rooms and Cleaning cupboards work in the exact same way, except that their ratio is 1 prisoner for every 4 squares. This means a maximum-sized laundry room or cleaning closet is 4x20=80 squares in volume, or a 8x10 square room.

Another strange quirk is that, deployment also cares about the physical size of the room that the workshop is in (the boundaries made by walls), not just the squares that you designate using the room tool. What this means is, if you put a 5x5 workshop into a 10x10 room, the game won't recognize that workshop as somewhere that prisoners can be deployed, because it doesn't fill the room that it's in. The exact mechanics of how this is calculated seem to be strange (it's not just a straight ratio), but in general it seems if you have more than ~55% of the room filled with workshop designated squares, then you can assign prisoners to that area. Note that this only affects whether you can assign prisoners or not: The amount of prisoners you can assign still depends on the raw volume of the squares assigned as part of the workshop using the room feature, not the size of the physical room that the workshop is in.

Finally, I should note that it is possible to designate a workshop that is larger than the room that it is in. In other words, the workshop can spill out of the room's door a bit, into a nearby hallway for example, but not by very much, or the room will stop being recognized as a place you can assign prisoners to. The way this is calculated is even stranger than the previous quirk, though, and I can't seem to pin down any of the rules for what determines it, but it is possible to squeeze out at least a few more squares to increase the capacity of a workshop. Just make sure you test it first to make sure it will work before you design your prison around it.

**TL;DR: Workshops can have 1 prisoner per 12 squares volume, up to 20 in a 16x15 room. Laundry rooms and Cupboards can have 1 prisoner per 4 squares volume, up to 20 in an 8x10 room.**