Neptune was discovered nearly 160 years ago meaning it has completed almost a full orbit since its discovery. There have been many, many observations of it since that date so we have a very accurate orbit, and more importantly orbital period. Given its orbital period it is easy to calculate its distance relative to the Earth-Sun distance (= 1 AU) by using Kepler's third law. Since both the Earth and Neptune are orbiting the same object, the Sun, their relative periods (P_{E} for the Earth and P_{N} for Neptune) give their relative distances (a_{E} for the Earth, a_{N} for Neptune) by:

(P_{N} / P_{E})^{2} = (a_{N} / a_{E})^{3}.

Thus:

a_{N} = a_{E} (P_{N} / P_{E})^{2/3}.

I hope that helps!