On the stems I’ve had, it’s been the actual length of the stem (hypotenuse). However, this has only been approximately true, suggesting there is no standard places to measure between. The stems have also varied in clamp height and where exactly the centre of the main tube intersects the clamp.
The saving grace is that handlebar position is a lot less critical than saddle position, so a few millimetres here or there doesn’t make a difference except in edge cases (the millimetre that broke the cyclist’s back!).