Sex is an anatomical property determined by one's DNA and observed in the structure of an individual's genitals and secondary sexual characteristics. Among humans, there are male, female, transsexual, and intersex.
Gender is a social construct determined by behavioral roles adopted on the (dubious) premise that individuals should or will exhibit sex-specific personalities. Among humans, there are man, woman, transgendered, and several rarer others.
Also not to be mistaken with sex and gender is sexual orientation, which describes an individual's preference for a sexual partner's sex. Confusingly, sexual identity has nothing to do with the individual's own sex, but is nevertheless worded in terms of the individual's own sex with the words "heterosexual" and "homosexual" (but not "bisexual," "auto-sexual," "asexual," and others).
Edit: Clarification.