find out. baby gender

Dulce
How many months or weeks do you have to be to find out the gender of the baby? The doctor told me 5 months but I've best hearing that is 4 month?!?!?!