Why are group 1 elements called alkali metals and group 2 elements are called alkaline earth metals? I was studying the periodic table. My teacher said that 


  Group 1 elements are called alkali metals because their oxides are soluble in water and group 2 elements are called alkaline earth metals as their oxides form in the earth and are water soluble.



What did she mean by "oxides"? Aren't alkali metals bases which are soluble in water? Then what is the term "oxides" doing here?
What is the difference between "alkali" and "alkaline"? Why do we call one of them "alkali metals" and the other "alkaline earth metals" when the concept is the same? 
Why are the bases of group 1 and group 2 elements soluble in water? What is the reason?
The description of the reasoning of the naming is … let’s call it simplified.

First, concerning your first point. Alkali metals are not bases by themselves, they are metals. Metals typically cannot be classified in the original Arrhenius or extended Brønsted-Lowry acid/base classification. The cannot dissociate to liberate either $\ce{H+}$ or $\ce{OH-}$ because they only consist of metal atoms. And they cannot act as a donor or an acceptor for protons — one because of the lack of protons and two because of the lack of favourable lone pairs.

It is only when we oxidise these metals in some way or another that they form a species that can interact with water in the acid-base formalities. One possibility for oxidation is simple burning, i.e. reacting with atmospheric oxygen. Unfortunately, only lithium is nice enough to ‘do what you might expect’, hence why I’m using that as an example in the following equations:

$$\begin{align}\ce{4Li + O2 &amp;-&gt; 2 Li2O}\tag{1}\\[0.4em]
\ce{Li2O + H2O &amp;-&gt; 2 LiOH}\tag{2}\end{align}$$

As we can see, the oxide we generated, lithium oxide, can react with water to form a hydroxide which dissociates into $\ce{OH-}$ ions — an Arrhenius base. We can also say that the oxide anion is capable of accepting protons donated by water — a Brønsted-Lowry base. Therefore, lithium oxide (and also lithium hydroxide) are the bases while lithium metal is not.

The second question is easily answered. Alkali is a noun and alkaline is an adjective. Thus, alkali metals is a compound word formed by two nouns while alkaline earth metals is also a compound word formed by two nouns where the first noun is further specified by an adjective.

The third question is difficult to answer. There is not really an easy or understandable explanation; it all boils down to churning numbers and finding out that the dissolution is favourable, i.e. the corresponding equation represents a decrease in Gibbs free energy: $\Delta G &lt; 0$.

We can break dissolution of solids into two general processes:


breakdown of the ionic lattice, i.e. liberation of individual ions from a solid

$$\ce{NaOH(s) -&gt; Na+(s) + OH- (s)}\tag{3}$$
dissolution of the individual ions

$$\begin{align}\ce{Na+(s) &amp;-&gt;[H2O] Na+(aq)}\\[0.3em]
\ce{OH-(s) &amp;-&gt;[H2O] OH-(aq)}\end{align}\tag{4}$$


The first of these steps requires energy because you are breaking bonds (this is always unfavourable). It is typically represented by $\Delta_\text{latt} H^0$ — the standard lattice enthalpy.

The second process is exothermic because the individual ions are now again somewhat balanced by the polar water molecules. It is typically represented by $\Delta_\text{solv} H^0$.

Both processes are favourable from an entropic point of view.

Whether the entire reaction $(5)$ happens, depends on the difference between lattice and solvation enthalpies. If the lattice enthalpy is too high to be offset by solvation enthalpies and the entropy effects, an ionic compound will not dissolve. For alkali metal oxides and alkaline earth metal oxides, the lattice enthalpy is typically low and thus they dissolve.

$$\ce{NaOH (s) -&gt; Na+ (aq) + OH- (aq)}\tag{$3+4=5$}$$

The actual reason for their names is in another castle beyond the scope of this answer. At first glance, I would forward you to the corresponding Wikipedia articles.