Rewrite the fraction as
$$\frac{m}{n}=\frac{p}{10^sq}$$
where $p,q$ are coprime and $q$ is not divisible by $2$ or $5$ while $p$ is not divisible by $10$. Computing $s$ (the pre-period) is easy; it is the larger of the number of times $2$ divides $n$ and the number of times $5$ divides $n$. Then we want the smallest $t$ such that $10^t\equiv 1\;(\bmod\;q)$. By Fermat's little theorem, we have $10^{\varphi(q)}\equiv 1\;(\bmod\;q)$, thus $\;t|\varphi(q)$ so it suffices to check the divisors of $\varphi(q)$.
Look at the classical division algorithm: after you have exhausted the digits of the numerator, you will continue appending zeroes 'past the decimal point'. As the remainder is smaller than the divisor, it is finite and the same values will come back periodically. The period length of the decimals cannot exceed the value of the divisor minus $1$.
Base $10$ example, $83/7$:
$83\div 7=10$, remainder $1$ ($=8-7$).
$83\div 7=11$, remainder $6$ ($=83-7\cdot11$).
$83\div 7=11.8$, remainder $4$ ($=830-7\cdot118$).
$83\div 7=11.85$, remainder $5$ ($=8300-7\cdot1185$).
$83\div 7=11.857$, remainder $1$ ($=83000-7\cdot11857$).
$83\div 7=11.8571$, remainder $3$ (=$\cdots$).
$83\div 7=11.85714$, remainder $2$.
$83\div 7=11.857142$, remainder $6$.
$83\div 7=11.8571428$, remainder $4$.
$\cdots$
Conversely, when you have a periodic number, if you shift it left by one period and subtract the original, you obtain a terminating number by cancellation of the decimals.
$$11857142.8571428571428571428\cdots-11.8571428571428571428\cdots=11857131,$$ hence the number is
$$\frac{11857131}{999999}=\frac{83}7.$$
Best Answer
The formal way to understand this is, of course, using the definition of real numbers. A real number is "allowed" to have infinite digits after the decimal point, but only a finite number of digits before. (http://en.wikipedia.org/wiki/Real_number)
(if it interests you, there are numbers that have infinite digits before the decimal point, and only a finite number after. Take a look at http://en.wikipedia.org/wiki/P-adic_number . just to have some fun, know that the $10$-adic expansion of $-1$ is $\color{red}{\dots 99999} = -1$)
If you want to get some intuition about this, first think that, as your teacher said, said number would approach infinity, which is not a real number. This is reason enough.
About the comparing two numbers part: if I give you $$1234.983...$$ and $$1234.981...$$ you know which one is bigger, it does not matter what the other digits are.
But with $$...321.99$$, $$...221.99$$ you don't, because the information relies in the "first" digit. Of course nobody know what the first digit is, since there is no first digit.
But as I said before, this is to gain some intuition; the correct way to think about this is using the definition (which is not trivial)