Some people use Blending Options > Stroke > (Set the colors), Inside stroke on a base background that covers up the image size, Then set the Fill to 0% so its just a border. But I use a more controllable method:
-Create a new layer, Place it ontop of the all other layers.
-Fill in the layer using the Paint Bucket Tool with whatever your border color will be. (Set the Foreground color to your desired color)
-Ctrl+Click the new layer [in layer panel], This will outline the border layer.
-While the layer is selected: Select > Modify > Border: set border size, I use 1 or 2px.
-After thats completed: Select > Inverse
-Delete selection
Now you have a border on a new layer that is independent, And not an active blending option.