The Fretboard diagram shown below shows all of the 6 strings over 12 frets with the 1st string being the thinnest and the 6th string being the thickest one. Guitars necks have anywhere from 21 - 24 frets, however, after the 12th fret everything repeats starting from the open strings. This means that all of the note names on the 13th fret are the same as the 1st fret AND the note names on the 14th fret are the same as the 2nd fret and so on. The difference is pitch, which means that the higher fret notes are an octave higher in sound.
In music there are only 7 letter name notes A - G. Notice that there is always an open fret space between the notes except for B-C and E-F? If you look on a keyboard instrument it is the same, there is always a black key between all of the white keys except for B-C and E-F. The black keys are the sharps & flats just like the blank frets between the letter names.
Sharps are played 1 fret higher so G# is played 1 fret above G.
Flats      are played 1 fret lower so Gb is played 1 fret below G.
These rules means that B# is played 1 fret higher on C while Cb is played 1 fret lower on B. The same rules goes for E & F.

Learning The Note Names

The dots on the fretboard at Frets 3-5-7-9-12 are position marks, which are used to help you to know where you are on the neck without looking at the fretboard. You should also see them marked on the top edge of the neck except for classical guitars as they don't have any position marks.

Here is an easy way to learn the notes of the fretboard and at the same time it will make your Left Hand fingers stronger & more independent. You will also learn how to move up & down the fretboard and the basics of hand positions. Use the following exercise to get started.
Starting with the 6th string;
  1. Use the L.H. (Left Hand) fingerings shown below.
  2. Play each note starting with the open string and move up the fretboard.
  3. Say each note name as you play it.
  4. Once you reach the 12th fret go back down in reverse order using the same fingerings & saying the note names.
6th String

Since the note names on the 1st string are the same as the 6th string you really learned 2 strings at once. Use the exercises below to learn the remaining strings. You can later use the Guitar Codex to test yourself using the entire fretboard.
Hand Positions

Notice that you have played across 12 frets but only moved your L.H. twice? This is the most basic rule about hand positions. You move your L.H. each time to comfortably cover an area of 4 frets.