Among those who study gender and sexuality, a clear delineation between sex and gender is typically prescribed, with sex as the preferred term for biological forms, and gender limited to its meanings involving behavioral, cultural, and psychological traits. In this dichotomy, the terms male and female relate only to biological forms (sex), while the terms masculine/masculinity, feminine/femininity, woman/girl, and man/boy relate only to psychological and sociocultural traits (gender). This delineation also tends to be observed in technical and medical contexts, with the term sex referring to biological forms in such phrases as sex hormones, sex organs, and biological sex. But in nonmedical and nontechnical contexts, there is no clear delineation, and the status of the words remains complicated. Often when comparisons explicitly between male and female people are made, we see the term gender employed, with that term dominating in such collocations as gender differences, gender gap, gender equality, gender bias, and gender relations. It is likely that gender is applied in such contexts because of its psychological and sociocultural meanings, the word’s duality making it dually useful. The fact remains that it is often applied in such cases against the prescribed use.
Usage of sex and gender is by no means settled. For example, while discrimination was far more often paired with sex from the 1960s through the 20th century and into the 21st, the phrase gender discrimination has been steadily increasing in use since the 1980s and is on track to become the dominant collocation. Currently both terms are sometimes employed with their intended synonymy made explicit: sex/gender discrimination, gender (sex) discrimination." https://www.merriam-webster.com/dictionary/gender