A musical key is a system of tones and harmonies based on a standard hierarchal scale of seven tones.
When first learning how to play any musical instrument, it helps to know whick sharp(s) or flat(s) are in each key. Here is a chart that helps one remember such, with an explanation near the bottom:

Sharp Order:         F#  C#  G#  D#  A#  E#  B#
Major Key Sign:      G   D   A   E   B   F#  C#
Flat Order:          Bb  Eb  Ab  Db  Gb  Cb  Fb
Major Key Sign:      F   Bb  Eb  Ab  Db  Gb  Cb

with "b" = flat and "#" = sharp.
How the chart works:
After choosing a Major Key Sign, that key contains the sharp or flat in the line above it, and all the sharps and flats to the left of that one.
For example, the key of B Major contains A#, D#, G#, C#, and F#.
The key of Bb Major contains Eb and Bb.