If you take a look at a piano keyboard, you'll see that it consists of repeating groups of seven white plus five black keys each. Each such group is called an octave (see picture below). White keys in an octave correspond to the C, D, E, F, G, A and B musical notes. After B comes C of the next octave.
The notes corresponding to black keys are referred to through their white neighbors. The "black note" between C and D is called C-sharp (C#), or D-flat (D♭). To be precise, the correct name of a black key depends on the musical context you're in, but for all our intents and purposes, those two names can be used interchangeably. Likewise, the black key between G and A is called A-flat (A♭), or G-sharp (G#).
So what is a key? Put simply, a key is a set of compatible notes upon which a melody can be build. Each such set is constructed by building a minor or a major scale from the tonic (the key's main note). A rule of thumb is that major scales and chords sound live-asserting and optimistic, whereas minor ones sound sad and low.
Since there's 12 notes in an octave, there's 24 keys in total – a major and a minor one for each of the 12 possible tonics. A key is referred to by its main note and the scale built from it. For example: D major (D), D minor (Dm) , B-flat major (B♭, B♭ major).
It's not accidental that a tonic is called the main note of a key. Whatever key a melody is in, it always gravitates to its tonic. The main note always fits together with any melody that's in that note's key, major or minor. As you'll soon see, this property of a tonic comes very helpful in finding the key of a track.