Sometimes, the theme or mood you wish to create with a song doesn't suit the generally "happy" sounds that a major key tends to provide. In these situations, a minor key is often the best choice for your song.
Which isn't to say that a song written in a minor key has to be "sad", or that a song written in a major key need be "happy". There are thousands of songs written in major keys that certainly not uplifting (Ben Folds Five's "Brick" and Pink Floyd's "Wish You Were Here" are two examples), just as there are many tunes written in minor keys that reflect positive, happy feelings (like Dire Straits' "Sultans of Swing" or Santana's "Oye Como Va").
Many songwriters will use both major and minor keys within their songs, perhaps choosing a minor key for the verse, and a major key for the chorus, or vice versa. This has a nice effect, as it helps break up the monotony that sometimes results when a song lingers in one key. Often, when switching to a major key from a minor key, writers will choose to go to the Relative Major, which is three semitones up (or, on the guitar, three frets up) from the minor key the song is in. So, for example, if a song is in the key of E minor, the relative major of that key would be G major. Similarly, the Relative Minor of a major key is three semitones (or frets) down from that key; so if a song is in D major, it's relative minor key would be B minor.
We've got lots more to discuss, but before we do, we need to learn what chords we can use in a minor key.