How to restrict a part of an object getting painted while texturing in blender
Masking using 'Face selection masking for painting' option.


Enable the Face selection masking for painting option. Press A to display the grid and select faces you want to paint using RMB.

Masking using painted stencil.

In Uv/Image Editor add a new image, change its name and set its color to white.

Paint the areas where you want your texture to appear with a black color (create a mask). Save an image. Your mask is ready.

In Slots bookmark of a Tool Shelf check the Mask checkbox, choose the UV map you want to use (the one with the painted stencil displayed). Then select your painted mask image (click on an image icon under the Stencil Image). If you want to inverse the mask click on the b&amp;w square under the Visualisation.

Add a new material and a texture (an image) you want to paint on. Now when you paint in a Texture Paint mode your brush strokes'll apear only in a black areas of your mask.