I think this totally depends on the overall look you are going for the home, for the room, and the mood of the room. Also, we need to talk about a few things here: 1) the colour shade of the paint, 2) the lustre (shine factor) of the paint and 3) different kinds of "trim". You may choose a different lustre for baseboards than you would your wall paint. And when I hear the word "trim" sometimes people are referring to the casing and trim around a doorway, the baseboards, their chair-rails, crown molding, ornamental trim, window trim.... there are a lot of different components here!
For the wall colour, you are probably not going to want a pure white paint. It's too harsh for a cozy home space. The shade of white that you choose will have another underlying colour tone to add warmth and visual comfort to the space.
Here is a pure white room:
Here is the same room with a warm cream added to the white. See how much cozier and warm it feels?
(Photo courtesy of One Kings Lane https://www.onekingslane.com/live-love-home/white-rooms/)
If you want to create a more intimate atmosphere in the room (great for a dining room or a living room, or a small room) then choose a shade that is darker than the walls. How much darker? Depends on how intimate or bold you want to be! If you want the room to appear brighter or larger, then leave it the same colour as the walls *or go with a pure white to really make it seem brighter and more open* Check out this photo: they created intimacy and tied in the accent colour of the room by painting the ceiling! Notice that they also painted the trim and molding the same color as the walls to really accentuate the accent colour. Which leads me to my next topic:
Pure White Trim
For the colour of the trim, baseboards, window trim, door trim, door casing... all that jazz... I often like when they are a pure white. Why? Because we have established that your walls are probably not going to be pure white. By making all your trim stand out as a fresh pure white, you are enhancing the colour tones in the white wall paint that you chose. Also - super easy to touch up pure white. It will always be the same. ;)
Trim the Same as the Walls
Here is when I recommend painting the trim the same colour as the walls:
Paint the crown molding the same colour as the wall if it's really large and elaborate. I also recommend painting any ornamental trim on the wall the same colour (and lustre) as the wall. Typically you only find these features in very traditional fancy homes (like the photo above.)
If you are using an accent colour as your main visual interest feature, you may really want to downplay your walls and have all the molding, baseboard, and trim blend in. (Like the photo example above),
Paint your window trim and sills the same colour as the wall when you have a stunning view outside and you really want to downplay the walls of your home, so that they are very subtle, and draw your attention to the scene out the window. (like the photo below)
Paint your window trim and sills the same colour as the wall when you have a large window in a small room. This prevents drawing attention to the overly large trim around the window and instead lays focus on the window (or light source if the window is tinted) itself. (like the photo below)
Photos courtesy of Unknown Source, and www.juliehanner.com
Door Trim & Casing the Same as the DOOR
There are times when it's best to paint the door casing and trim the same colour as the door, even when your walls are white. Sometimes you will use your accent colour on a door. This generally draws attention to the door, while softly complimenting the accent colour in the room. If the door is an accent feature, it's really nice to frame it in the same colour. (See photo below)
Photo courtesy of devolkitchens.com
Luster or Sheen
It's tricky to get a good photo to depict different sheens of light with a photo, but let's use this one as an example:
Photo courtesy of: https://www.btlpropertyltd.co.uk/
The higher the luster (or sheen) of a paint, the more reflective the surface is. High gloss sheens will show more imperfections in your surface, but it will also be more durable due to the higher concentration of binder (often epoxy resin).
Luster of Baseboards, Door Casings, and Chair Rails
I recommend choosing at least a satin sheen for all baseboards, door casings, and chair rails. Anywhere you are going to have high traffic, it's best to increase the sheen for durability. If your paint is gloss (you might choose this or a semi gloss for a bathroom or kitchen because it will help with wipe-ability and preventing moisture damage to the paint) then you match the baseboards, door casing, door trim, and chair rails to that lustre.
Luster of Crown Molding & Ornamental Trim
Match the luster of the crown molding and ornamental trim to the wall. You don't need it to be more durable than the wall paint in the room.
Luster of Window Trim & Sills
Typically, I would match this to the wall in the room, except if you are going to be placing things on the window sill (like one in a kitchen, or plant pots for decoration in a sunny window.) In that case, up the sheen for durability purpose, if your paint is lower than a satin.
Luster of the Ceiling
In most rooms, it should be flat. This is so you are not drawing any attention to little imperfections on such a broad empty space. In a bathroom, however, use a semi-gloss or gloss for moisture protection. You might also do this in a small kitchen.
There are a LOT of different options and choosing the right colour and sheen of paint can really change the atmosphere of your room... or make or break functionality. Hopefully this blog post gives you some direction! If not, feel free to send me a message and ask for help :)