What is measured by hub size? When they say 135mm hub I don't particularly understand. What are you measuring? The radius?

They say that a particular hub will be short for fitting gears. I say if I change rear wheel completely, then is the problem solved?
The width, from locknut to locknut.