Total the runs, then count the corners. The corner count matters as much as the length, because every corner is a mitre and every mitre eats material and offers a chance to cut it wrong.
Measure each wall at floor level, from corner to corner. This is one of the few jobs where you genuinely want the floor-level dimension rather than a reading taken at waist height, because that is where the trim sits.
Subtract door openings. Baseboard stops at the door architrave on each side, so a doorway removes its own width plus the width of the casing on both sides from the run.
Do not subtract windows unless they run to the floor. A standard window sits above the baseboard and the trim runs straight past underneath it.
Note fireplaces, built-in units and anything else the trim stops at. Each one interrupts a run and creates two ends.
This is the part that turns a length into a materials list.
Internal corners are where two walls meet going into the room, which is most corners in a normal rectangular room. Four of them in a plain room.
External corners are where the trim wraps around a projection: a chimney breast, a boxed pipe, a partition wall end. These are the ones that get missed when working from a list of wall lengths rather than a sketch.
Each corner is a mitre, and mitres waste material because the cut is at an angle across the piece. More importantly, each one is a chance to cut a piece too short, and a short mitred piece cannot be rescued.
Trim comes in fixed lengths. A 14 foot wall covered with 12 foot lengths needs a join, and a join in the middle of a long wall is visible. Check the available lengths against your longest walls before ordering, because sometimes a slightly more expensive longer length removes joins entirely.
Worth knowing, because it changes how much you allow.
Many carpenters cope internal corners rather than mitring them: one piece runs into the corner square, and the second is cut to the profile of the first so it fits against it. Coped joints hold up better than mitres when the house moves and the corner opens up slightly, which it will.
Coping uses slightly more material per corner than mitring and takes longer, but it is the more durable joint. External corners are always mitred, because there is nothing to cope against.
Trim waste is higher than people expect because of the mitres and because offcuts are usually short lengths that do not fit any remaining run.
Allow more on a room with lots of corners, projections and short wall sections than on a plain rectangular room. A room with a chimney breast and two alcoves has six more corners than the same room without, and each of those is an angled cut with an offcut.
Ordering long is sensible here for the same reason as everywhere else: trim is milled in batches and profiles vary very slightly between runs, so a topping-up length may not match the profile of what you already have.
While you are measuring at floor level, take the rest of the trim in the same pass.
Measuring them all in one visit means one sketch and one order. The wall measuring method is here, and the paint calculation, which treats trim separately, is here.
If you have arrived at the wrong page for what you need, start here instead.