In anthropology, gender is the accepted way to refer to a set of behaviors and beliefs that are most often, but not always, tied to physical sex traits. It is more correct to say that gender relates to sex roles, although that is also ambiguous, and perhaps too narrow.
You can have a gender that is different from your biological sex, if your culture permits (or even if it doesn't, as we have been discovering in the last century). There is no limit to the various types of gender roles that are possible; the specific ones that you are likely to be aware of depend on the culture you live in. It is also worth re-emphasising that gender does not necessarily relate to sexual orientation; in Western culture, for example, 'gay' is not currently recognized as a gender role. Gender is only a social role that identifies your relationship to others; in the case of gender, the roles in question are any roles that are in contrast to (and including) the roles of male and female.
Cultures almost always have two 'default' genders: male and female. These correspond directly to one's sex. Other genders may or may not be generally recognized. While male and female (based on sex) are obvious choices for genders, this does not mean that another culture's "male" gender will be anything like yours. For example, many cultures include "homosexual" behaviors in the default male gender.
In America (and elsewhere, of course) we also have a lot of people who do not fall into these categories, which upsets a lot of people. We do not have a formalized and widely accepted cultural system accounting for all the common genders. A general attempt at categorizing the genders that are common in America usually looks something like this:
We are probably due for a gender paradigm shift. Other cultures have long had other gender roles, the most well known of these being the berdache found in some Native American peoples, and the South Asian hijra.