Dotted Borders
Using the pen tool can be quite handy when you want to draw borders around awkward shaped objects. For a cool design effect, try creating custom dotted borders! Open up your image in Photoshop and create a new layer
For this tutorial, I will be using the following image:

Set Up
First thing we should do is set up the dotted pattern for the border. You can use any type of brush, but for learning purposes, I will show you how to create a dotted border with Photoshop's default Basic Brushes set. To activate this set simply select the brush tool and in the Options menu bar up top, Load the set.
Click to enlarge:

Next, you want to have the brush spacing set greater than 25% so you see dots instead of a solid line. To do this, open the Brushes Pallet. If you do not see this, click F5 to open. Use the following settings:

Here, I set the Brush Tip Shape to a 3px round brush with a spacing of 236%. I prefer my dotted borders to be thin and spacious, but you can have different preferences. For instance, you can use a larger pixel size closer together, or maybe 1px side by side. It is up to you how you would like your border. The preview box below should help you see what the end results should look like.
The Pen Tool
In order to stroke around your image with your new dotted brush, we need to create a path first. Make sure you have your new layer active. Select the Pen Tool
from the Tools menu and begin tracing around your object. In case you do not know how to fully use the Pen Tool, simply click points around your objects to connect lines. If you drag your mouse, you will end up with curved lines if necessary. For my example, I used straight lines for those who have difficulties creating curves with the Pen Tool.

Where you make a path line, that is where the dotted brush will follow, so if you want the border farther away from the image, do not trace so close to your object at this stage.

You have the option of either enclosing your object within your path or just leave the shape open. For my example, I closed my path since I want a border all around.
Stroking
This next part is where the action is. We will stroke the path you just made with the brush settings we made earlier. First, select the foreground colour you want the border to be. By default, the colour setting for this is White. Next, with the pen tool still selected, right click on your image and select Stroke Path… from the drop down menu.

A pop-up window will show you options for stroking. Since we fixed up the Brush settings, select the Brush Tool from the drop down menu and leave Stimulate Pressure unchecked since we did not change the settings to allow this. Hit the OK button.

Final
Now that you have stroked your path with the dotted brush, you still see the path line ontop. To get rid of this, simple hit the delete key on your keyboard. Here is my final result:

Play around with different brushes, try using a square brush for a different effect. You can repeat this tutorial over again if you wish to add a second border of different size, shape or spacing. Just have fun with this!