The major scale
Let's start by examining the C major scale on the A or 5th string, 3rd fret.
The notes on the major scale are C-D-E-F-G-A-B-C by name.
Since the guitar is a symmetrical instrument, several patterns will be constant. This is the first:
A whole step (W) spans the distance of 2 frets, a half step (H) spans the distance of 1 fret. (There is one exception, but we don't have to worry about that until we start crossing strings)
That said, the pattern of the major scale is: W, W, H, W, W, W, H
What this means is this, if we look at another scale, like the D scale, with the same pattern, the notes by name would be: D-E-F#-G-A-B-C#-D.
This is because naturally in the major scale, the difference between E and F as well as B and C is a half step. This turns out to be VERY important.
As you can see, the C Major scale and the D Major scale look exactly the same, follow the same rules... they just sound different.