If you're a photographer, you may very well not use the Photoshop's Pen Tool very often. It's more often used by designers and artists. In fact, it's a very useful tool for photographers who are serious about post-production speed and quality, and in this tutorial I'm going to show you why.
1. The Pen Tool
The Pen Tool is a vector tool. Instead of the path shape data being a long string of pixel coordinates, it uses a handful of points and some equations to describe how they interact. Vector equations are infinitely scalable without loss of quality, simply by using larger multipliers.
The paths it creates have Bezier Handles to allow complete adjustment of magnitude and direction (the two vector properties) of the control points of the line. You can adjust shapes and follow curves very precisely with Bezier curves.
Combine this with Photoshop's Convert Path to Selection button and Refine Edge function, and you have yourself a very powerful, yet surprisingly simple, selection tool for precise masking.
2. Creating the Path
With the Pen Tool selected, follow the line you're bordering your selection to. The Bezier handles are simple click-and-drag affairs, though it may take you a little time to get used to how the one point can interact with a large section of the line.
Once your point is in place, you can hit A to switch to the Direct Selection Tool. Normally, this is a black pointer and moves an entire shape. Holding Ctrl makes it a white pointer which can interact with individual control points, allowing you to edit Bezier handles. Holding Alt/Option while adjusting a handle splits it from its mirror handle on the control point, allowing you to create acute points and angles.
3. Creating Your Selection
Once the path is complete, open the Paths palette and click the small dashed circle at the bottom to Load Path as a Selection. The marching ants should appear immediately, and the path is deselected. Now is a good time to go to Select > Modify > Feather... or hit Shift-F6. This allows you to soften up the razor-sharp edge of the vector line to appear more natural in your image. I generally use around 0.3-0.5px.
If you're selecting anything detailed and not-sharp like hair, now would be a good time to use Refine Edge. If you're not familiar, we have a great quick tip on how to use it.
4. Saving Your Path
Once you're done with the selection, and you've deselected or masked, note that the path you used is still in the Paths palette, called "Work Path". If you drag the path to the "New Path" icon at the bottom of the palette, it will save the path as "Path 1" and not discard it if you create another path. You can rename the path just like in the Layers palette, or duplicate the path by dragging it again to the "New Path" icon.
If you need to reuse your selection, just open the Paths palette and your path will be there to convert to selection again. If you need a larger or smaller version of the selection, just duplicate the path, hit A, click on it, and then Ctrl-T to free transform it. Duplicating it means you have an original sized version in its original location, should you ever need it.
The path can also be applied as a vector mask to a layer, though this is more useful in design, since photography tends not to have such ultra-clean lines. You can rasterise the vector mask and manipulate it from there, however.
That's All There is to It
That's really all there is to it, but becoming accustomed to creating adjustable, reusable, saveable selections can greatly improve your workflow. It is, of course, possible to save regular selections, but it's not as easy as having them right there in the Paths palette.
Most of the photographers I've seen using this technique have been the higher end commercial photographers in the pursuit of pixel-perfection, but there's no reason why the rest of us shouldn't reap the advantages of the technique.
As ever, questions? Comments? Hit up the comments below!