Not OP, but to qualify the question:
At least in the United States, teachers at early "public" schools seem to have been mostly male. At the very least, this is how 19th century writers like Hawthorne depicted their 18th-century ancestors. By the mid-19th century the "schoolmarm" stereotype appears in contemporary fiction by authors like Mark Twain and Harriet Beecher Stowe.
Yet my the late 20th century, there had developed a persistant sterotype that teaching, especially in primary schools, was a "feminine" profession.
How and why did this gendered understanding of teaching come to be in American cultural life?
In this article there is a table (Table 2) that shows the percentage of male teachers by decade (roughly). There is also a historical summary on page 4 which says it better than I can. However, here is the money quote:
Defining teaching as women’s work could be interpreted as a remarkably clever marketing tool used by educational reformers to meet the demand for teachers. The vacuum created by the exodus of men to the factory floor — complicated by the proliferation of new teaching positions — had to be filled by someone.
Just to preface this, this is not a deep response crossing multiple countries. It looks only at the case of Australia. However, Australia's education system does (apparently) have similar trends to much of the western world/other OECD countries.
Firstly, this would depend on country, what type of school we're talking about (primary/elementary vs. secondary) and subject (I won't be delving into subject as it gets even more complicated, but basically stem is still male dominated, languages/arts is female in secondary). For example, within Australia (where my data is from), female primary school teachers heavily outweigh male primary school teachers with a ratio of approximately 4:1, whilst for secondary schools, the gender balance is much more equal^1 . Another thing to note from that source is that even within the same state, there was up to an 8.4% difference in the number of male primary teachers, depending on location. Taking this into account, an actual answer to this can get a bit tricky.
From the Australian Bureau of Statistics, in 1982 there were 2.4 female primary teachers to every male, which went up to 3.8 in 2002. Now, this isn't the most helpful in determining an answer in terms of primary school teachers, but does give guidance to at least pre-1982. What interesting information is given, however, is that in 1982, there were only 0.8 female secondary teachers, meaning males still dominated in this market, and in 2002, this had raised to 1.2. Assuming the rate had changed linearly, it would be assumed gender balance occurred around 1992 for secondary teachers^2 .
From a QLD government publication, "In 1969, females, for the first time since 1933, constituted a majority of the teaching force, and by 1983 the percentage of females employed (60 per cent) was approaching the highest ever (61 per cent) reached between 1918 and 1920."^3 So, it would seem women outnumbered men around 1918-1920, however, the tables turned and men again became the majority. It took ~49 years for women to take back the majority share. Again, showing the complexity of the issue and not just a simpler "well, in x year!" This document also goes further into depth about why this happened and whatnot.
Whilst I haven't been able to 100% answer this question, and can only provide insight into one place, I hope this is of some help.
https://www.det.nsw.edu.au/media/downloads/about-us/statistics-and-research/key-statistics-and-reports/staff-information/male-school-teachers.pdf Note: although this is for NSW, the rest of Australia has very similar statistics.
http://education.qld.gov.au/library/docs/edhistory/female/female-1940.pdf
Of possible interest:
This World Bank site allows you to see the percentage of female primary teachers across all countries, with data from 1981-2015 (note: some data is missing). http://data.worldbank.org/indicator/SE.PRM.TCHR.FE.ZS
There is also this UNSECO one that allows you to look at female teacher percentage from 1999 onwards across a range of different educational settings, from pre-primary to tertiary. http://data.uis.unesco.org/index.aspx?queryid=178