In general terms, "sex" refers to the biological differences between males and females, such as the genitalia and genetic differences. "Gender" is more difficult to define but can refer to the role of a male or female in society (gender role), or an individual's concept of themselves (gender identity).
From "Sex and Gender: What Is the Difference?" by Tim Newman.
There's a summary of other related terms found here. One of the terms not found in this summary is "cisgender." Cisgender is a fairly new term and it basically defines a person who was born a male or female and is comfortable identifying as such.
What puzzles some people is why someone would choose to be transgender. Choice is not an option, there is an explanation as to why people may not identify as the gender they were born with--genetics. To read more, click here for an article from Nature.
Biologists may have been building a more nuanced view of sex, but society has yet to catch up. True, more than half a century of activism from members of the lesbian, gay, bisexual and transgender community has softened social attitudes to sexual orientation and gender. Many societies are now comfortable with men and women crossing conventional societal boundaries in their choice of appearance, career and sexual partner. But when it comes to sex, there is still intense social pressure to conform to the binary model.
Califia, Patrick. Sex Changes: Transgender Politics. [eBook]
Kuklin, Susan. Beyond Magenta: Transgender Teens Speak Out. [YA 306.768 KUK]
Nutt, Amy Ellis. Becoming Nicole: The Transformation of an American Family. [eBook]
Out of the Ordinary: Essays on Growing Up with Gay, Lesbian, and Transgender Parents. [306.874 OUT]
Whittington, Hillary. Raising Ryland: Our Story of Parenting a Transgender Child with No Strings Attached. [eBook]