Gender is nowadays used in several ways. One is common in feminist writing, where the term has a technical meaning. “One is not born a woman, one becomes one,” argued Simone de Beauvoir: in other words, one chooses one's gender. In such a context it would be absurd to use the word sex; the term must be gender. But, in using it thus, try to explain what you mean by it. Even feminists do not agree on a definition.
The primary use of gender, though, is in grammar, where it is applied to words, not people. If someone is female, that is her sex, not her gender. (The gender of Mädchen, the German word for girl, is neuter, as is Weib, a wife or woman.) So do not use gender as a synonym for sex. Gender studies probably means feminism