too many bikes from 1967 10s (5x2)Frejus to a Sumitomo Ti/Chorus aluminum 10s (10x2), plus one non-susp mtn bike I use as my commuter
There are a few dimensions.
The fit to the fork, ie the diameter of the quill, usually 22.2mm (7/8") or 1" to fit into the fork with threaded headsets, and 1-1/18" 1" (rare) ID, to fit over the fork in threadless versions.
The length (or extension) which is measured along the horizontal (or sloping) top from the center of the fork to the center of the stem. These are typically in 10mm increments, so you can use a ruler and eyeball the measurement. Note. there are a few stems that measure on the 5s but they're rare, and usually only toward the short range, ie, 85mm or 95mm,
Then there's the stem angle between the extension and line of the fork. You'll need a protractor, and a straight edge to measure this.
Then if you have a quill stm, there's also the height. Some folks measure the overall height, others only from the minimum insertion line to the top. This is usually not discussed except when someone is shopping for a tall stem - non-standard.