This is about Kohlberg's theory of gender development. By the age of seven most children will recognise their own gender, other people's gender and understand the fact that a wig or a skirt does not change a man into a woman. They have then passed from the stage of gender consistency into the stage of gender constancy.
Children learn the social meanings of gender from adults and culture. Beliefs about activities, interests, and behaviors associated with gender are called “gender norms,” and gender norms are not exactly the same in every community.
The gender schema theory of 1981 started a rash of anxiety about providing gender determined toys, so that girls were pressed to play with tractors and boys with dollies to reverse 'societal pressures.' Most recently, field experiments with chimps clearly show that females gravitate towards dolly toys and males towards footballs and vehicles.