I am trying to understand, what is a guitar scale pattern ? For example, following shows "C Major Scale Pattern."
What exactly is the purpose of a scale pattern ?
The dots indicate the notes that are in the C major scale. The red ones are C. The "patterns" are places where you can easily reach all of the notes of the scale. For example, in Pattern 4, you place your index finger on the 7th fret, and then you can play a C major scale 2 octaves (plus an extra note on top and bottom) just with your 4 fingers, without having to slide out of position.
This is useful because you can take that same pattern and apply it on a different fret to get a different scale with no extra dexterity needed. Slide up a fret and now you're playing C#/Db major. Slide down a fret and now you're playing B major.
Matt Putnam offered an excellent answer but based on some of the comments a more complete explanation might be helpful for those who still are not sure how scale patterns can be useful for a guitarist. TLDR - skip to summary.
The guitar and similar fretted instruments give the player options for multiple places on different strings and frets to play any given tone - unlike a piano which typically can play 88 different tones but has only one place to play each of them (one key per tone).
Playing a C major scale on a keyboard is a simple linear exercise where you begin on any of the C keys and play each successive white key to the right until you get to the next C (one octave higher). Similarly, other scales played on keyboard will involve a similar linear pattern (but with some black keys used in place of some white keys).
On guitar, there is no easy linear progression where the next note is always to the right of the previous note in the scale unless you play the scale on one string and go from one end of the neck to the other. So playing a scale on guitar sometime means moving a fret or two on the same string or moving to a different string where the next note in the scale might either be to the left or the right.
A "scale pattern" for guitar is a way to play a given scale in an efficient (with minimal distance between notes) manner from a given position on the neck. A scale pattern diagram can be used to show any type of scale (major, minor, modal) (diatonic, minor pentatonic, blues).
The good news about playing scales on guitar is that the "patterns" are the same for each "key" a scale can be played in. So a particular pattern which can be used to play a C Major scale (pattern two for example) can also be used to play a Major scale in any other key simply by shifting the starting position the new key (use the root positions in the pattern as a guide). So once you learn a particular pattern, you can use it for all the keys for that type scale (major, minor, etc).
So for example if you learn pattern 2 as shown in your question for the C Major Scale and want to play a D major scale - you simply move the pattern up by two frets on the neck and play the exact same pattern! On keyboard, even though the pattern is similar in that it's linear and left to right (if playing the scale in ascending order) the "pattern" is different because to play the D Major scale you must skip some white keys and play some black keys.
So whereas on keyboard, if you wanted to be able to play a major scale in 12 different keys, you would basically have to learn 12 patterns. With guitar, you can play a major scale in 12 keys by learning only ONE pattern! The reason you might want to learn more than one pattern is so that you can play a given scale at any position on the guitar neck - from near the head-stock to near the body.
The other good news is that there are realistically only 5 practical patterns that you need to learn for any given type scale (minor pentatonic, blues, major, etc.) to be able to play almost anywhere on the fret-board. You could come up with a 6th pattern for some scales if you have an extended fretboard and don't mind playing all the way to the end of the neck near the bridge.
Learning patterns are useful for improvising or soloing or playing lead guitar riffs or fills during a song. They are also useful for playing melodies by ear if you are so inclined. It is not necessary to learn any patterns if you only want to play chords, rhythm guitar or pre-defined arrangements of songs. But if you want to be able to create your own unique arrangements, knowing some scale patterns would be helpful.
If you are improvising over a blues progression and you have learned some of the common "patterns" for the blues scale, you can find the notes you need that are in the correct key by starting the pattern at the correct position on the fretboard for that key. You can play the scales in several positions if you know 3, 4 or 5 patterns - so you can carry your soloing through multiple octaves and make it more interesting.
To summarize - the purpose of a scale pattern is to show some practical ways that a particular type scale can be played on the guitar fret-board at different positions on the neck. The reason to learn the patterns is that they repeat for each possible key that a particular type scale can be played in. Patterns are particularly useful when composing or soloing because they allow you to know where the correct notes are for the key or scale you want to compose or improvise in.
EDIT: To clear up some potential confusion, a scale is played from root through the root at the next octave. The Scale Patterns shown in the answer are carried past the root to root actual "scale" to show where the notes were if you continued the scale past the octave which is common during improvising or soloing. Each "Scale Pattern" shows both the actual scale which is red dot to red dot (the root note of the scale) and the extensions that can be reached from the same position on the guitar neck. So to play the actual scale itself, you would start on the root and play through to the octave of the root both shown in red. Technically if asked to play a C major scale from position 2 shown above - you would begin on the 3rd fret of the A string (red dot) not on the E (6th) string - and end on the 5th fret of the G string (red dot). But while improvising from that position, you would have the option of playing the extended notes on the 6th string or the 1st or 2nd string. The Scale Patterns are usually extended in this manner (past the beginning and end of the scale itself) to show all the notes of the scale that are reachable from a given position.
other way to approach scale paterns is tonality: when you use "normal" scales, you structure around one tone and its near frequecis. You have twelve notes, with no deferences among them, but if you go to DIATONIC scales ( scales that alternates semitones and entire tones) you can work giving more importance to some of them and then create PROGRESSION. If you take scale patterns like in the first answer, it's true that is for position references.
Since this bubbled back to the top, I figured I would take two seconds and put some pictures to my words in the comments as supplement to the (better) answers here.
I wrote "[...] another way to research the "why" is to look at the CAGED method. [..] All chords are "barred" chords (including the open chords where the nut is a free finger). So as you barre the c using A-form, g-form etc, you will see the scale itself being defined. Like footprints in the sand."
Images are CAGED (in order):
And C Maj scale is:
Notice that the uncolored dots are octaves of dots that are have a color, they can also be thought of as incomplete fragments of a barred chord "above" or "below" the 6 given strings of a guitar. Note there are one or two gaps as well.
My apologies for any errors I may have introduced.