Here is an excellent example of how I seal and "cut" the wall paint into the window trim. I always finish the trim first, paint the walls after, never the other way around.
Paint Used: Benjamin Moore Aura Satin - Cloud White
The paint line is straight and there are no openings caused from cheap caulking shrinkage.
Caulking: DAP 230
DAP 230 is excellent caulking. It is the only brand I use. It has very little shrinkage in comparison to the regular DAP or other brands. Its choice for caulking around all your new trim.