Ideas about gender change from early childhood to childhood. Let me illustrate by a real-life, embarrassing example. A family friend lost her hair during chemotherapy. #2 was about 4 years old and #1 was 7 years old. During a face-to-face encounter, we were all chatting while #2 just stared at our family friend. Eyebrows grew more and more furrowed. During a pause in conversation, #2 blurts out, “Are you a boy or a girl?” Before I could interject an after-school-special about gender and hair, #1 answered, “She’s a girl. Girls can have bald heads too.” Was I embarrassed? Totally. Was my friend awesome about it? Absolutely. Was #2 being a jerk? Not at all. My kids were perfectly illustrating how ideas about gender change from the preschool to school years. #2 was perfectly exhibiting how in early childhood, children think very rigidly about gender.[a] #1 was perfectly illustrating how ideas about gender become more flexible in childhood, as children learn about exceptions to gender-stereotypes.
During the first few years of elementary school children continue to learn and form ideas about gender. By 1st grade or so, children have very clearly formed ideas about gender and gender roles, but they are more flexible in how they think about gender stereotypes than they were when they were younger.  For instance, children might realize that not all boys like sports, not all girls like dolls, and that even though girls normally have hair, they don’t always (Thanks #1!). This doesn’t mean that children don’t have gender-stereotyped ideas; they absolutely do. But they are starting to become more flexible in identifying exceptions to their ideas about gender roles.
By 5th grade, children understand that gender is a social category, not a biological one.  This is huge because it allows children to consider that your biological sex – being male or female – is not necessarily the same as the socially defined gender roles. Children are often supportive of children doing what they want, even it goes against social gender norms. For example, an old study from the late 1970s found that children thought boys who like dolls should get to play with them.  But the kids at this point were also savvy enough to understand that this might mean that the boy would get teased.
During the elementary school years, children also begin to understand gender discrimination. 8- and 9- year olds don’t think it is fair to exclude people from activities on the basis of gender (for example a boy not being allowed to join a ballet class).  As always, parenting does matter. Girls with more gender-egalitarian beliefs, garnered from their families and caregivers, were more likely to recognize sexism.  But just because children might identify gender discrimination doesn’t mean that they don’t discriminate on the basis of gender – during the elementary school years children will commonly exclude other children on the basis of gender. This rings true, doesn’t it? “No Girls Allowed” and “Girls Only” signs decorate the tree houses and bedrooms of childhood.
In a bit of a Russian doll situation, there are gender differences in these ideas about gender differences. First of all, gender typing during childhood is more rigid among boys than girls. Boys are more likely to endorse gender stereotypes than are girls, and girls are more likely than boys to play with cross-gender-typed toys or engage in cross-gender-typed activities.  For example, it’s somewhat common to see girls playing stereotypically boy sports in elementary school, like soccer or baseball. It is less common in elementary school to see boys playing stereotypically girl sports, like gymnastics or ballet. This is at least partially because boys actively avoid traditional feminine activities. Rigidity in thinking about gender normal behavior declines across the elementary school years, but boys consistently remain stricter about gender typing than do girls. 
Why is it that girls are more flexible in their gender roles than boys? Scientists think it has to do with how parents and society reacts. People react more to a boy violating a gender norm than they do to a girl violating a gender norm. A 3rd grade boy wearing a dress is likely to get a lot more negative responses than a 3rd grade girl who is climbing a tree. The term for girls who engage in stereotypically boy activities is a tomboy – socially, being a tomboy is often worn as a badge of honor. There is no parallel word to describe a boy who engages in traditionally girl activities. In fact, if words are applied to these types of boys, they aren’t polite or intended to be a complement.
As parents and caregivers, it is important for us to be mindful about what stereotypes we are passing on to our children. Reflecting upon our own values for ourselves and our families, and being conscious of how it affects our parenting is an important exercise. Sometimes this can be as small as being careful about the language you use or how you react to a situation.
[a] See my article about Learning About Gender in early childhood.
 Katz, P. A., & Ksansnak, K. R. (1994);Liben, L. S., Bigler, R. S., Ruble, D. N., Martin, C. L., & Powlishta, K. K. (2002).
 Carter, D. B., & Patterson, C. J. (1982);Stoddart, T., & Turiel, E. (1985).
 Damon, W. (1977).
 Killen, M., & Stangor, C. (2001).
 Brown, C. S., & Bigler, R. S. (2004).
 Killen, M. (2007); Maccoby, E. E. (1999).
 Levant, R. F. (2005); Brown, C. S., & Bigler, R. S. (2004).
 Serbin, L. A., Powlishta, K. K., Gulko, J., Martin, C. L., & Lockheed, M. E. (1993).