If the spindle (aka the shaft) has threaded stubs that take nuts at each end, you measure the overall length between the square bases of the threaded stubs, i.e. you don't include the length of the stubs in your measurement.
Better quality spindles do not have these stubs and the ends of the square tapers have threaded holes that take bolts. These you measure end-to-end.