Before answering said question, I'd like to explain some of the benefits of understanding keys...
First off, it will provide you a conceptual framework so that you can begin to make sense of music. Also it will make writing, analyzing and figuring out songs/ chord progressions easier. Finally understanding keys will allow you to be more conversant with other musicians.
So, what is a key?
Keys are multi factorial animals, I think a good way to begin thinking about them if you're a beginner or intermediate player is to think of keys as scales, chords and arpeggios that all are built out of the same series of seven notes.
Most interesting songs use notes, scales, chords or arpeggios that are "outside" of the key - this means at least one note used is not present in the major or minor scale that the key is based on but plenty of great songs don't.
If all the chords in a given song/progression conform to the chords in a given key, that is called a "diatonic" chord progression. Learning the diatonic keys first is very important.
...Up next, major keys...