The stage of Piaget's cognitive developmental theory typically correlated with gender development is the concrete operational development stage. This is when a child begins to understand their relationship to people, places, and things outside of themselves and how their actions can influence external processes. Psychologist Lawrence Kohlberg developed gender development theory rooted in Piaget's concrete operational development theory, suggesting that children come to understand their gender roles through observation and then action. (This is similar to Freud's gender theories in which children model their same-sex parent and romanticize their opposite-sex parent.)
Kohlberg suggests that gender identity is formed before age 8 and that once a child understands their gender identity, it becomes fixed and will not change, specifically based on external factors (e.g. hair length, clothing, occupation).
The most compelling affirmation of gender development theory, Kohlberg's in particular, is in the quality of primitive modeling. Any behavior that is not inborn is a modeling behavior, including gendered behavior. For example, every human innately knows how to urinate. Whether we urinate standing up or sitting down is based on modeling.
The most compelling argument against gender development theory is that gender itself is not a fixed notion. Gendered behavior cannot be conflated with biological sex, therefore simplified notions based on anatomy are not accurate. Gendered behavior also changes over time, and across cultures; therefore the acquisition of gender expression is relative. For example, the gendered judgement "only women should wear makeup" can only be true in particular cultural and historical contexts; it discounts over 5,000 years of recorded history that suggests otherwise.