One of the basic concepts you need to understand in order to move around the guitar fretboard is the semitone.
The semitone is the smallest musical interval commonly used in Western tonal music. On the piano, each successive key raises (or lowers the pitch) of the note struck by a semitone.
On the guitar each fret raises (or lowers) the pitch of a string by a semitone.
There are 12 semi-tones in an octave. So the 12th fret is the Octave Fret for each of the strings. The 12th fret has the same pitch as the nut, only an octave higher.