Gender is a description of societal expectations associated with the individuals biological sex
Gender is used to differentiate masculine and feminine societal roles, while sex is concerned with biological differences between male and female individuals. As gender is a social construct it is thought to be used as a way of establishing social norms for gender in society. This helps in maintaining contrasts in male and female roles in society, thus helping people operate in society in a normal way.
Recently many gender studies thinkers have proposed that such sex-linked societal gender roles are obsolete and should have no reflection on an individuals gender role. However, while it's true that there is certainly deviation, gender identity is not completely independent of biological sex. Psychological studies have found that the proportion of masculine men compared to feminine men is about a 60/40 split in most societies. Likewise there is a similar divide when comparing feminine woman and women that demonstrate mostly masculine traits. There is a lot of overlap, but it is clear there is some biological link between an individuals sex and their predisposition to display masculine or feminine traits, factors ultimately used in building the individuals gender identity.