Forks with unthreaded steerer tubes are deliberately sold too long and are custom cut to length to fit the bike, spacer stack and stem clamp length. It's not a big deal but you have to think about what you are doing when you measure.
Forks with threaded steerer tubes have to be close to the right length or the lock nut won't fit. Generally you can measure the length of the bike's head tube and add the stack height (available from the manufacturer) of your headset. Round up the next longer steerer tube length. If necessary you can either cut a bit off of the threaded fork or add a spacer under your headset lock nut to make everything come out even.