Gender is often loosely described as the psychological parallel of sex. But this is more like a simile than a description. It is also often noted as being in the mind e.g. the genderbread man.
When you look for a more complete description results vary. It is sometimes described as:
A person's expectation of their physical sex. This implies that we know in our heads what our secondary sexual characteristics ought to be, in the same way that we have an awareness of where our arms and legs are. This relates strongly to gender dysphoria. Under this definition of gender transgender people are defined by their feelings of gender dysphoria, which is to feel that your secondary sexual characteristics are somehow incorrect.
Gender is also sometimes described as a personality label. Under this definition we associate different genders with different averaged personality. No real personality exactly fits a gender, but like the difference between a feminine face and a masculine face we identify ourselves by that which we are closer to. So for example having a larger nose is generally a masculine face trait but there would still be predominantly female faces with large noses, just as attention to detail is predominantly a female trait but there will still be male personalities that incorporate high attention to detail.
Gender is also described as a set of socially constructed roles. There are behavior patterns and activities that are associated with different genders. The behavior of an individual defines their gender. This would make gender entirely a social construct.
This is probably not a complete list. I also suspect that multiple items might be 'true' (or perhaps useful is a better word) simultaneously. The word gender clearly has many different meanings to different people. I would like to know what meanings are out there and who uses each meaning. Please feel free to only add one definition.