A sharp ( # ) raises the pitch of a note by one semitone. A flat ( b ) lowers the pitch of a note by one semitone. In music notation the # and b signs (called accidentals) are always placed before the note heads.
As you can see from these examples, the same note can have two different names (i.e., F# and Gb are the same pitch and have the same position on the fretboard). These are referred to as enharmonic notes. Other examples of enharmonic notes are: A#/Bb, C#/Db, D#/Eb, F#/Gb, G#/Ab. (This principle also applies to the naming of chords, e.g., A# Major = Bb Major, C#m7 = Db m7 etc.)
A sharp or flat, when placed before a note, affects the remainder of that bar. It does not, however, affect notes in the next bar. Note that a natural ( @ ) cancels the effect of a sharp or flat.
With the inclusion of sharps and flats, there are 12 different notes within one octave, e.g.:
Note that there are no sharps or flats between B and C, or E and F because those notes are already a semitone apart.