The painting is over, you have cleaned up the rollers, all of the brushes are drying, the drop cloths are folded, you closed the paint, and now you start to pull the tape and with great enthusiasm you see the paint come right off the wall with the paint you just completed? Or there are all kinds of locations that have paint that went under the tape?
To stop the paint from bleeding the best thing to do is wipe down the surface and then use Frog tape! it works and works well.
The paint peeling can happen for a variety of reasons. One reason is that the previous paint was applied to bare drywall. Regular paint has a hard time adhering to bare plaster. Another reason is that the wall was dirty before you applied the paint. Then there is the paint and tape combination. When there is an excess of paint dried to the tape and when you pull the tape you pull the paint with it.
There is nothing you can do if the surface was never primed before, but the other issues you can remedy by using good paint and good tape.