It could take many years for your child's gender to be determined, it really depends on whether they identify as a male or female.
Now, the sex (whether they have a penis or vagina) can usually be seen as early as 14 weeks, but most doctors like to wait until 17 weeks or later to make a real sex determination.