Always use only masking tape or painter's tape when masking areas to protect them from paint. Other types of tape have stronger adhesives, designed to grip with enough force that they will tear paint away. If the tape you have is designed for masking but is still tearing up paint, try a different brand. Avoid using tape that's more than a few months old, since the adhesive can become gummy and stick more strongly in certain areas. That's true of tape rolls that have been left in the elements.
When applying tape, remember that it has to stick just enough to stay in place and cover the area you don't want painted; if you've had trouble with paint pulling up (or think you might), apply the tape gently. Simply lay the tape in place and run your finger over it lightly to seal it, ensuring the edge on the fresh-paint side is secure to the surface. Do not apply firm pressure.
If you're having problems with painter's tape pulling up newly applied paint, try waiting a little longer before you remove the tape. When fresh paint is dry enough to touch without spreading but before it has fully cured, it won't be as strong as it will be once it's had a full day to dry and cure. Try to peel the paint after its surface has dried but before the coat cures completely.
The manner in which you remove the tape will determine how well the tape pulls away without pulling paint with it. Pull slowly, foremost, and tug the strip of tape at a 90 degree angle to its placement plane, creating a fold at the apex between the stuck tape and the pulled-up tape.
Sometimes it's impossible to keep painter's tape from pulling up old paint because the paint has already begun to chip and fall away so much that any stress will remove it. If this is the case, you have to remove the old paint before you apply any tape. If you want to remove only the portions of the paint that are naturally chipping and falling away (rather than all of it), sand the edges of the missing areas of paint so they won't show up beneath a new coat of paint.