How is a pipe nipple's length measured?
I looked at some manufacturer's documentation. Short answer: the stated size is the total length of the pipe nipple including the threaded sections.
This does appear to be consistent among manufacturers (at least in the US / North American market).
Also an important detail is that the length of the threaded sections is standard for each pipe diameter. So with a little information you can figure out what length the unthreaded middle portion of the pipe nipple has.
Length diagram from Anvil Intl.:

Alternate
And their accompanying diagram of the available standard nipple lengths. What's important about this is the &quot;close&quot; lengths - these are nipples that are fully threaded, and so its the shortest total length they could be at that diameter. If you subtract this from any of the others you get the unthreaded length.
Example: a 1&quot; size pipe 6&quot; long. The close length is 1 1/2&quot;, so the remaining unthreaded portion must be 3 1/2&quot;. (Plus or minus 1/8&quot; as noted on the first diagram).

These documents state &quot;APPLICABLE SPECIFICATION: ASTM A733&quot; which means, I think, that these measurements should be consistent among manufacturers.