To create a mask:
Select any layer, or create a new layer by pressing Cmd+Y (Ctrl+Y).
Click on the Pen Tool in the Tools Palette.
Click anywhere in the composition window to make a vertex point.
Continue clicking to add points.
Return to the first point you made to close the mask. You'll see a circle icon appear next to your Pen Tool to indicate you are closing the mask.