Stem angle is one of the factors that determines handlebar height. A listed angle of 0 degrees actually provides a rise that is dependent on your bike’s head angle (see image).
Stem length is measured along the side of the stem from the center of the steerer to the center of the handlebar clamp (see diagram). Keep in mind that as a stem provides more rise, its effective length decreases. In the example above, if the +17 degree stem measures 135mm, it actually extends 108mm parallel to the ground.