If the cabinet trim is stained and has a polyurethane finish, paint will not stick to it because of this protective coating. Sand down the trim, removing the polyurethane. Then paint the trim your choice of color.
If you used latex paint to paint the trim and it is peeling when you remove the painter's tape, sand down the trim that you painted and repaint it. This time do not remove the tape for a week. Latex paint takes longer to cure than others like oil-based paint, and will peel if you try to remove the tape too soon.
If your cabinet trim has an oil-based enamel finish, it will not bond with latex paint, causing it to peel. Scrape the peeling paint from the trim. Then prime the trim with a solvent-based primer to dissolve the finish and allow the latex paint to bond with the trim.
Switch to an oil-based paint. Scrap off the peeling paint. Sand the trim down. Prime the trim with a paint primer. Then repaint the trim using an oil-based paint. This paint will cure in 24 hours instead of a week and be ready for a second coat if needed at this time. If you live in an area with high humidity, though, do not use oil-based paint because it will take longer to dry in that climate.