Gender refers to the socially constructed attributes of the different sexes. Every society places different expectations on different genders. There are different expectations of behavior and societal and familial roles based on gender.
People identify and express gender both externally as well as internally. This makes it a very personal part of identity. We can think of gender as to how someone expresses elements of their identity that we often classify as masculine or feminine. However, this binary form of classification often falls short of the reality for many people.
In this way, gender is different than sex, which is the biological, physical, and physiological elements of what makes an individual female or male. Gender, on the other hand, is less straightforward. It has more to do with an individual's sense of what makes them male, female, or another gender.
Gender exists on a spectrum. It is not always simple to identify with a particular gender. Most people's gender aligns with their sex, but this is not always the case. Gender is an identity that can change and defy societal expectations.