1. Sex - chromosomal and usually physical (phenotypic) presentation of what you are - Male, Female, hermaphrodite
2. Gender - what you "feel" you are, partly biological and partly a result of cultural values - male, female, or a mixture in the middle called androgynous
3. sexual orientation - heterosexual (attracted to people the opposite sex as you), homosexual (attracted to people the same sex as you) and pan/bisexual - attracted to both to some degree
there can be mixes of all of the above - like transgendered - someone who feels and may act/dress like the opposite sex, cross-dresser (straight person who likes to dress like the opposite sex for sexual reasons),
There are biological aspects to the brain which correlate with sex, gender, and orientation - but there is not necessarily an established causal link between having your brain configured in that manner and what you are. There are also societal considerations in which behaviors are encouraged or discouraged, think of the ancient greeks where homosexuality was encourage among the armed forces, or present day conservative christians who view it as sinful behavior that should be changed and strongly discouraged.
Overall, it seems like the originial feelings/drives are biological, but how the behavior looks is affected by the culture you are a part of.