What is the difference between a generalization and an extension?
Let's start with two examples:
Suppose you have a function $f\colon(0,1)\to\mathbb R$. You can turn this into a function $\tilde f\colon\mathbb R\to\mathbb R$ by defining, for example, $\tilde f(x)=f(x)$ when $x\in(0,1)$ and $\tilde f(x)=0$ otherwise. The function $\tilde f$ is an extension of $f$, not a generalization.
Maybe you have proved earlier that if $x\leq y\leq x$ for some real $x$ and $y$, then $x=y$. But in fact the same holds true if $x$ and $y$ are matrices. There is a natural definition of "$\leq$" for matrices. In the case of $1\times1$ matrices you get the original version back. The result for matrices is a generalization of the result on the real line. I would not object to calling this an extension, but I would prefer to use the word "generalization" instead.
I would say that in general objects are extended and results are generalized.
You might want to extend your field from the reals to the complex (or make some other field extension), or you might want to extend the domain of definition of some function. Generalization is a more general result that contains the original result as a special case. If the original result is not included, I would not call the new result a generalization but and analogous result inspired by the original. Similarly, if a new function is somehow inspired by an old one but does not "contain" it, I would prefer to call it an induced function rather than an extension.
I agree with Joonas that "extension" can be used to refer to objects, such as functions extended to a larger domain while preserving some properties, or in field extensions (a larger field containing the original one). However, we do often use the same word to refer to generalizations of a theorem as well, namely we could say something like "We can easily extend this result to an arbitrary metric space.". Hence you see things like "extended mean-value theorem" and "extended Bayes theorem" and "extended Green's theorem". Also, the Wikipedia article about the binomial theorem even uses both words together: "The generalized binomial theorem can be extended to the case where x and y are complex numbers.".
The bottom line is that the words "generalization" and "extension" turn out to just have the natural English meaning even when used in mathematics, most of the time. It may nevertheless be worth pointing out that there is one technical meaning of "extension" in the field of logic, which has little to do with the common English meaning.