First, your use of terminology can be improved. A limit (if it is defined) is just a number, and there is no such thing as a number with a discontinuity. It is your function that may have a discontinuity (and also which may have a limit at$~a$). In the example, the function is given by $x\mapsto\frac{x^2-16}{x-4}$, although it is not explicitly named.
That function is not defined at$~4$, since setting $x=4$ the fraction becomes $\frac00$ which is undefined. It is defined everywhere else, so its domain is $\Bbb R\setminus\{4\}$. To say that a function is continuous or discontinuous at a given point requires that point to be in the domain of the function; therefore you cannot say that you function is discontinuous at$~4$. In fact the function in question is nowhere discontinuous: it is continuous in all points where it is defined, but this excludes the point$~4$.
However for taking the limit of a function$~f$ at a point$~a$, it is not required that $a$ be in the domain of$~f$, just that some neighbourhood of $a$ the result of removing $a$ from that neighbourhood is contained in the domain of$~f$. That's a whole mouth full, but one of the main purposes of limits is to sometimes extract information from a function at points where it is undefined, so the definition must avoid requiring $f(a)$ to be defined. In fact the definition of limit is such that whether or not $f(a)$ is defined is completely ignored: the limit of $f$ at$~a$ depends only on values $f(x)$ for $x$ close but unequal to$~a$.
However, it is a theorem that should $\lim_{x\to a}f(x)$ be defined and the value $f(a)$ as well, then the two are equal if and only if $f$ is continuous at$~a$.
So here's how the reasoning goes. Whenever $x\neq4$ one has $\frac{x^2-16}{x-4}=x+4$, so $x\mapsto x+4$ is a different function from the original one, but one that takes the same values as the original in all points where the original was defined (and in addition the new function is defined at $4$ where the original wasn't). One says that the new function extends the original function. Now since the limit at$~a$ ignores whether a value at$~a$ is defined, one knows for certain that $\lim_{x\to4}\frac{x^2-16}{x-4}=\lim_{x\to4}x+4$ (one side is defined whenever the other is, in which case the two are equal). But $x\mapsto x+4$ is an everywhere continuous function, so in particular $\lim_{x\to4}x+4$ is well defined. Moreover, by the cited theorem this limit must be equal to the value of the new function at$~4$, which value is $4+4=8$. But then also $\lim_{x\to4}\frac{x^2-16}{x-4}=8$ (even though the original function is not defined at$~4$).
You may note that this computation of the limit never even uses the definition of limit, just the knowledge of certain properties of limits and continuity. In fact many limits can be so computed without using (or even knowing) the exact definition of limits. It seems like a swindle, but that is how mathematics often works. (To be sure, one does need to know and use the definition of limits in order to prove the properties that were used.)