The color of a cat's fur is determined by genes, and there's no specific genetic link between color and sex. So, a black and white cat could be a male or a female.
It's possible that you've heard this myth because black and white cats are often associated with the tuxedo cat breed. However, tuxedo cats come in both male and female varieties.