First, I suggest looking this up in the Wikipedia but I'll go into it a bit.
Intervals are described using both endpoints, that is the notes spanned, like using "Ocho días" for "week" in Spanish. Thus the interval C-C is a unison; C-D is a second, C-E is a third, ... C-B is a seventh, and C-C (the next higher C) is an octave. It's a funny linguistic thing as the word unison (in most languages) refers to a single object. C-C contains 1 note. C-E can be considered as the C,D,E and thus is a third.
Second point, there are only 7 different letters used even though a chromatic scale has twelve notes. C-D is a second though the note C# (or Db) is in between; E-F is also a second. The term "major" is used for a "nominal" second containing a two half steps; "minor" is used for a second containing a single half step. It's complicated because it grew over time and the various terms added gradually.
The rationale for having such a complicated nomenclature is that originally, the half and whole step intervals were not all equal. See the Wiki article on Temperament. The 8 nominal intervals spanning an octave have assigned ratios. In the table below, the ratio is of the second note to the first.
C-C is 1/1
C-D is 9/8
C-E is 5/4
C-F is 4/3
C-G is 3/2
C-A is 5/3
C-B is 15/8
C-C is 2/1
Unfortunately, these ratios cannot be extended exactly. There is a problem in that the ration of D to C is 9/8 but that of E to D is 10/9; these are close but not identical. Thus no consistent naming of intervals by frequency is possible with the above ratios. If one uses an equally tempered scale, then each half step has ratio of the twelfth root of 2. Many instruments (winds, strings, voices,...) do not naturally produce this equal temperament so the historical names of intervals and notes is still in use.