Note: I made a few edits regarding sex assigned at birth. I had originally intended to explain this concept rather than arbitrarily attribute sex to genitals, but I did not and the mistakes were brought to my attention.
Sex is the way people's genitals lead to social expectations that will be assigned at birth. People born with vaginas tend to be female-assigned at birth. People born with penises and testicles tend to be male-assigned at birth. People born with indeterminate or other forms of genitals tend to be assigned intersex, though many such people will actually be assigned as either female or male and raised as girls or boys.
Gender is individually and socially/culturally determined. Most people identify as men or women — these are the binary genders — some people do not.
Gender identity is the way a person feels about their gender. It often but does not always correspond to the sex assigned at birth. Many men are male assigned at birth, and many women are female assigned at birth. These people are cisgender, or more specifically, cis men or cis women. Some people who were male assigned at birth identify as women; these people are transgender, and specifically, trans women. Some people who were female assigned at birth identify as men; these people are also transgender, and specifically, trans men. Some transgender people undergo sex-change operations so that they feel their bodies better match their gender identities. Some transgender people do not. Some men have penises and some men do not. Some women have vaginas and some women do not. Gender does not necessarily have anything to do with sex.
Other people, regardless of sex assigned at birth, identify as genders other than men or women. Anyone who does not identify as a man or a woman is said to be non-binary because they do not fall within either of the two binary genders. Another umbrella term for all such people is genderqueer. An umbrella term for all people who are not cisgender is trans* (with the asterisk). Some examples of other non-binary genders are agender, genderless, third gender, two-spirit, genderfluid, or androgynous.
Gender expression is the way a person outwardly shows their gender. This has to do with the way a person chooses to speak, dress, arrange their hair, move, or otherwise use their body. For most people, gender expression matches their gender identity. For people who may be more genderfluid, genderfuck, or androgynous, or for people for whom it is not safe or comfortable to be out about their gender identity, their gender identity may not match their gender expression.
Sexual orientation refers to the pool of people toward whom a person might experience sexual attraction or desire. Straight (or heterosexual) people tend to be men or women; straight men might be sexually attracted to any woman, whereas straight women might be sexually attracted to any man. Gay or lesbian (or homosexual) people tend to be men or women; gay men might be sexually attracted to any man, whereas gay or lesbian women might be sexually attracted to any woman. Bisexual people might be sexually attracted to any man or woman. Pansexual people might be sexually attracted to people of any gender identity. Asexual people generally never experience sexual attraction toward other people regardless of gender. People who are not straight are sexual minorities by statistical reality. Another term that is controversial in some circles but which has been largely reclaimed to refer to anyone who isn't straight is queer.
Romantic orientation refers to the pool of people toward whom a person might experience romantic attraction or desire. Heteroromantic people tend to be men or women; heteroromantic men might be romantically attracted to any woman, whereas heteroromantic women might be romantically attracted to any man. Homoromantic people tend to be men or women; homoromantic men might be romantically attracted to any man, whereas homoromantic women might be romantically attracted to any woman. Biromantic people might be romantically attracted to any man or woman. Panromantic people might be romantically attracted to people of any gender identity. Aromantic people generally never experience romantically attraction toward other people regardless of gender.
Romantic attraction is not the same as sexual attraction. People may be romantically attracted without ever being sexually attracted, and other people may be sexually attracted without ever being romantically attracted. While romantic and sexual orientations usually align for most people, this is not always the case.
Sexual and romantic attraction are also not the same as sexual and romantic behavior. A gay man might marry and have sex with a straight woman. This does not change his sexual orientation. It only reflects his sexual behavior. An asexual person might have sex with a sexual person. This does not make the asexual suddenly not asexual. It only reflects their sexual behavior. A straight, sexual person might choose never to have sex in their entire life. This choice does not mean that the person has become asexual. The person has become celibate. Celibacy is a choice. Just as someone can attend services or participate in rituals of a religion to which they do not belong without that making the person a convert, a person can engage in sexual activities inconsistent with their orientation and that does not chanage their orientation.
Asexuality is an orientation. Asexual romantic relationships are not platonic friendships; they are asexual romantic relationships. Romantic relationships, whether the people involved are asexual or sexual, are different from platonic friendships.
Sex, gender identity, gender expression, romantic orientation, and sexual orientation are five separate attributes for each person. One does not necessarily follow the other, and there are almost infinite number of combinations of sex, gender identity, gender expression, romantic orientation, and sexual orientation that a person could have.
People can also be monoamorous, or interested and desiring only relationships involving two people (one partner), or polyamorous, or interested and desiring relationships involving more than two people (more than one partner). These designations and desires also have nothing to do with any of the other characteristics already discussed.
Please feel free to correct me in the comments if you feel I have missed something or explained something incorrectly.