Why do you need to learn all the notes on the guitar neck? Because knowledge of where each guitar note is on an instrument is absolutely basic to any serious study of it. You must know where all the notes are to understand how to create chords and how guitar scales are formed.
On a 6 string guitar with standard tuning the notes on the guitar neck start with an E on the top string when the string is played open.
If you press down on the first fret on the top E string you’ll now be playing an F. As you move one step up the fret board, you also move one note up the musical scale.
This is the the standard 12-step musical scale, starting on E:
E – F – F# – G – G# – A – A# – B – C – C# – D – D#
Here is a diagram of the frets and notes on the guitar neck. We only go to the 12th fret because then it repeats.
The most important part of improvising guitar is to know where all the notes on the guitar neck are. You should be able to glance at any note on the fretboard and know its name. If you don’t know what guitar notes you are playing you will find improvising extremely difficult.