Normally you just select the area where you want the border or 'box' (with the marquee/crop tool in PS) and use stroke (Edit > Stroke in PS) to add the line. You can also choose the color, size, and opacity of the line in the stroke box too.
If you wanted the image to 'fall out' of the border you can do the above step on a new layer and then erase the line where it covers the image so it looks like the image is coming over the border.
|