Yes, there are grammatical genders in German.
In English only persons or things that are somehow personlike (like pets, android robots and sometimes even ships), can be masculine or feminine. Everything that is not personoid is always neuter in english.
This is not true in German. Things (to be more precise: words for things) can have any of the three genders. A knife (das Messer) is neuter, a fork (die Gabel) is feminine and a spoon (der Löffel) is masculine. But as said before: Not the things carry the gender, the word are the things that have a gender.
There are things, that have more than one name. You call this synonyms. For example, the word "car" can be translated as »das Auto« (neuter), »der Wagen« (masculine) or »die Karre« (feminine) ("Karre" is a shabby car). You can use all three words for the same thing.
Also pronouns have a grammatical gender. It always has to match with the word it refers to:
Das Auto meines Bruders ist rot. Es ist vier Jahre alt.
Der Wagen meines Bruders ist rot. Er ist vier Jahre alt.
Die Karre meines Bruders ist rot. Sie ist vier Jahre alt.
(Remember, that we talk in all three sentences about the very same car.)
Also mention, that the biological gender of a person does not always match with the grammatical gender of the word that is used for this person. Most famous example: The girl is »das Mädchen« in German, which is not feminine but neuter. Same for »das Weib« ("Weib" is an old and pejorative word for "woman").
Das Mädchen ist hübsch. Es hat lange Beine.
Dieses Weib ist schrecklich. Es macht alles kaputt.
But for this case (non-feminine grammatical Gender for biological female person) there is a relatively young exception (young compared to other rules). You can also use feminine pronouns:
Das Mädchen ist hübsch. Sie hat lange Beine.
Dieses Weib ist schrecklich. Sie macht alles kaputt.
The word »Schlüssel« is masculine. For this reason, in a dictionary you will either find "(m)" for "masculine", or the masculine article "der" ("der Schlüssel"). And since the key is masculine in German, you have to use a masculine pronoun when referring to »him«.