Gender means 'type'. It is a word that is used to talk about how people put off masculine (traits most people think of as male) and feminine (traits most people think of as female) traits. It is commonly used for a person's sex (male or female) but this word only means someone’s biology (body parts). 
Definitions and history
"Gender" comes from the Latin word genus which meant "kind" or "type". In the few hundred years before the 1950s, the term 'gender' was used only in the field of grammar. In 1955, a scientist began to use the word gender in new ways when referring to people, in a way that was related to their 'sex' but not quite the same.
Before the 1950s, the term 'gender' was used only in the field of grammar, and only to distinguish a category of words that are called 'feminine nouns' from other words that are 'masculine nouns'. Early Indo-European languages~had three genders. Languages that come from Latin like Spanish, French, and Italian have lost one, and their nouns are either feminine or masculine in gender. For example, in Spanish, 'house' (casa) is feminine, and 'day' (día) is masculine. Some languages still have three genders, like German. Outside of their grammatical category, the word 'gender' was not used to refer to people. At that time, when one spoke about someone being either 'male' or 'female', the word used was sex.
In 1955, John Money created the term gender role and began to use it to mean something different from sex. Gender roles are how a society thinks different genders are like and are used to tell people of different sexes how to act should act. Some examples of this are often times people view feminine or female people as better at cooking or cleaning rather than doing sports. These roles change over time but differ based on different groups of people, but they are all ideas that are created by people rather than coming from nature.
‘Binary’ comes from the Latin word bini meaning two together. As such binary refers to an idea in which there are only two possible options that are often opposite. This is how most people thought of gender throughout history in many parts of the world with male and female being the two options.
Thinking of gender in this way can lead to a society with strict gender roles that are in place for a long time to think that those are natural or biological roles that each option has to conform to at birth. Examples of this are women who are not allowed access to education or jobs or men who are expected to not be emotional or soft. Strict binary gender roles are also often tied to reasons for oppression of sexualities outside of the majority. Societies often enforce gender binaries due to concepts like tradition and the idea that their stability relies on keeping this binary in place.
Although many societies still exist under a gender binary, more and more around the world are becoming more accepting of ideas of gender outside of strict male and female categories. An important thing to know about gender in this form is that the people who exist within them have always existed but have not always been free to express themselves. One example of this is people who are transgender, those who were labeled based on their biological sex, but eventually come to realize that label does not fit what they identify with. In addition to this, some people do not experience gender in a way that fits into a binary at all, and these people are called either non binary or genderqueer.