To add a bit more, gender seems to be determined (but is not set in stone) at conception. The saving-a-bit-before-labor-and-going-back-again to get a different gender trick is only for alien-implanted babies, though afaik, that doesn't work with woohoo-conceived children, as it's too late by then to change the baby's sex. This would sort of seem to imply that by that point, the game has already determined if the baby is a boy or a girl (or perhaps it decides when the medical Sim checks, but that would seem even more strange). What I do know is that a medical Sim has a social option to 'determine gender of baby' that appears once the bulge appears (that is, mom switches to maternity clothes). Some people believe that eating the fruit earlier in the pregnancy (before the bulge shows) has a better chance of affecting the pregnancy. Eating more than three doesn't further increase the chances eating them in a dish doesn't count (gotta eat the raw fruit).
The three fruits (watermelons for girls apples for boys) can, in theory, be eaten at any time from conception to labor, but all they do is increase the chances of a boy or girl, they don't guarantee it.