Let's say you're walking into a jam session with a few tunes that you know well.  Then a singer and harmonica player show up and they want to play the songs in a different key.  Fear not!  It's super easy to change keys on guitar.  With this simple system you can fit all the chords into a new key and be ready to jam in no time.

Say you learned the song in the key of G major, which has these notes:
G A B C D E F# G

Simply number them off:
G A  B  C  D  E  F# G
1  2   3  4   5  6   7  1

We build chords on top of each of those notes and those can be numbered the same way.  The only difference is that when we talk about chords we use Roman numerals. Upper case means a major chord, lower case is minor.

G  Am  Bm  C  D  Em  F#dim  G
I     ii     iii    IV V   vi     viidim   I

We call those "diatonic chords", which is just a big word meaning those are the chords that naturally occur based on the key signature.  Our key signature in this case is one sharp (F#).  What makes this easy is that the same combination and order of major, minor, and diminished chords is the same in every major key.  Now you have numbered chord relationships that are portable to any key you need.

The easiest way to remember them is I, IV, and V are major.  Everything else is minor except the vii, which is diminished.

Let's do an example.... Say you've got a song in the key of C with this chord progression.
C  F  G7  C  Am  Dm  G7  C

We can quickly number them based on the key of C to look like this:
C  F  G7  C  Am  Dm  G7  C
I   IV  V7  I    vi     ii     V7  I

And the harmonica player asks you to play the song instead in the key of Bb.  Start with your Bb major scale:
Bb  C  D  Eb  F  G  A       Bb
I     ii   iii  IV   V  vi  viidim   I

Then transpose those numbers from your song's chord progression.
Old Key: C    F  G7  C  Am  Dm  G7  C
              I     IV  V7  I    vi     ii     V7  I
New Key:Bb Eb  F7 Bb Gm  Cm  F7  Bb

And just like that, everyone is happy in the new key.

Just about any key on the guitar is as easy to play as any other key.  That gives you a huge advantage in accommodating other instruments.  Want to see a keyboard player squirm?  Tell him that song in the key of C now needs to be in Ab.  It's easy for you now!