With the small containers you get the first slot for free. The other 3 slots you have to unlock.
With the big containers you get the first four slots for free. The other 6 slots you have to unlock.
First container you only need one brick per slot. After that you will need additional materials like sledgehammers and hard hats. I already built a few containers, and I don't remember exactly how many of each...
You can put one house from your game board in a slot. You have to have built that house already, and after putting it in the slot, it disappears from your game board.
A small container can hold 4 houses, so a total of 16 citizens.
A big container can hold 10 houses, so a total of 40 citizens.
The containers are a way of saving room on your game board, because they take less space than the houses together (small is 2x1, big is 2x2)