This is a fairly common practice. You record your main guitar part as one take. Once you've listened to it and are satisfied, the sound engineer plays you back a stereo mix. In one side of your headphones you have the backing track and in the other, you have the guitar part you just recorded. You use the guitar part as a guide and record another section as near to the original take as possible. Once two sufficiently similar takes are taped, the mix engineer pans them hard-right and hard-left respectively to split the guitar part over the stereo image. The guitar solo in "Smells Like Teen Spirit" by Nirvana features a prominent example of this technique.
Layering is similar to a stereo overdub, with the distinction that the two guitar parts aren't panned. Rather than panning, the guitar parts are mixed dead center so that they are seemingly "on top" of each other. This layering effect makes the guitars sound thicker and louder. A desirable side effect of layering is when the parts phase. Because they are two distinct takes of the same riff, rather than copies of one riff, there will times when notes are pitched slightly higher, lower, later or earlier than the original. This creates a sense of depth, as if two guitarists are playing together.
Partial layering is only applied to selected parts of the track, to add emphasis and weight to important melodic motifs. The process is similar to typical layering, but you must remember to stop yourself when the relevant part has passed.
By playing the same riff an octave, or eight notes, higher or lower than the original you create a sweet, thick sound. It works with chords too. Playing the same chord sequence one octave higher creates a "wall of sound" effect.
Rather than playing the melody an octave up or down, you play it at a pleasing harmonic interval. It's the same principle as harmony singing, but with the same "voice" singing each part. The lead riff in "The Boys Are Back In Town," between chorus and verse, features some impressive harmony guitar.
A blended overdub is where you play the same riff or melody, but use a different guitar sound. For example, the start to "Ziggy Stardust" by David Bowie features an electric guitar riff overdubbed with an acoustic guitar. This technique also appears on "Into The Lungs of Hell" by Megadeth.