Animals all across the world have specific jobs for the different genders, so really gender roles developed early on in the evolution of animals.
Well this question is a little difficult to answer as it's a little vague but the term "gender role" was coined by New Zealand Psychologist, Dr. John Money in his (and his colleagues) 1955 paper An Examination of Some Basic Sexual Concepts: The Evidence of Human Hermaphroditism.
Money et al (1955) coined "gender role" purposely to differentiate between that and "sex role". Money is famous for his involvement with David Reimer (whom was born "Bruce" unfortunately during circumcision as a young baby, Bruce's penis was burnt resulting in Reimer's parents seeking help from Money whom they saw on That Was the Week That Was & Money advised the Reimer's to raise Bruce as a girl unfortunately this had disastrous consequences) as well as his work with hermaphrodites (now known as "intersex").
Money et al (1955) described that roughly six variables defined "sex" & that in ordinary people these variables matched up without any doubt. These variables were:
Assigned Sex
The external appearance of genitals
Corresponding internal reproductive structures
Corresponding hormonal & secondary sexual characteristics of your assigned sex
That the gonads (the reproductive glands) are producing the correcting gametes for your assigned sex.
That the chromosomal sex is correct (e.g. two XX chromosomes for females & XY chromosomes for males. n.b. Some males have been found to have a second "Y" chromosome which can attribute to certain characteristics)
In the Money's studies of intersex people the criteria above wouldn't in the majority of cases match. Money defined "gender role" as the following:
all those things that a person says or does to disclose himself or herself as having the status of boy or man, girl or woman, respectively. It includes, but is not restricted to sexuality in the sense of eroticism. Gender role is appraised in relation to the following: general mannerisms, deportment and demeanor; play preferences and recreational interests; spontaneous topics of talk in unprompted conversation and casual comment; content of dreams, daydreams and fantasies; replies to oblique inquiries and projective tests; evidence of erotic practices, and, finally, the person's own replies to direct inquiry.
However even though Money coined "gender role" as late as '55 doesn't mean that "gender roles" weren't already at play unbeknownst to everyone else. This probably would date back to Antiquity but I'm far from confident in my knowledge of the classical world to give a definitive answer on that part. Sorry.
"Gender Schema" is another theory that attempts to explain how society genders individuals into certain roles. First hypothesised in 1981 by Psychologist, Sandra Bem (also the creator of "The Bem Sex-Role Inventory"). Bem states that "sex-typing" (as well as "gender-typing") is the process in which a child becomes aware of their sex or gender & the sex/gender of others around them.
Bem divides "sex-typing" into four categories; 1) Sex-typed, 2) Cross Sex-typed, 3) Androgynous & 4) Undifferentiated. Those that fall into category 1 become influenced & share the views & thoughts of solely their gender, those in category 2 become influenced & share views & thoughts of solely the opposite gender. Androgynous individuals share views & thoughts of both genders whilst Undifferentiated individuals don't hold any of either gender's views/thoughts. Bem says that many things can influence how one feels in regards to their gender; how they're raised, media & peers.
Bem has written extensively on the psychology of Gender. Another psychologist, Lawrence Kohlberg coined the term "gender constancy" which is in line with Bem's theory of Gender schema. Kohlberg states that "gender constancy" is:
A child's realization that gender is fixed and does not change over time.
And that this usually takes place between the ages of 2-3.
Hopefully this answered your question somewhat, if you have any more questions feel free to ask. :)
Sources:
Money. J et al (1955); An Examination of Some Basic Sexual Concepts: The Evidence of Human Hermaphroditism
Bem. L. S. (1981); Gender schema theory: A cognitive account of sex typing source
Kohlberg. L (1984); Essays on Moral Development: Vol .II. The Psychology of Moral Development: The Nature and Validity of Moral Stages