Most women can usually find out from having an ultrasound at week 18 or so, around the four-and-a-half month stage of your pregnancy. One way they can tell is by the position of the baby. The position he or she is in gives a good indication of the gender.
If your doctor has the new 4D ultrasound (nuchal translucency) then you might be able to find out as soon as at the 13th week of pregnancy.