Right-click on the layer you want to give the "square" to, click on Blending options. Choose Stroke and change the color to black, tick the box besides the name Stroke, choose size of stroke in pixels and then click OK.
EDIT: Here's a tutorial I just made in 10 minutes.