There's not a particular time to have sex that will guarantee a boy. It's a 50/50 chance. It depends on which gender of the sperm meets with the egg first.
Actually, there is a way you can tip the odds a little.
The basic philosophy is, male sperm swim fast and die sooner than female sperm, and are generally less hardy than female sperm.
So what you want to do is make it perfect for the sperm. Any stress (having to wait on the egg to be released, difficulty in PH level in the woman's body) make it harder to conceive a boy because the male sperm perish.
To conceive a boy, try to have sex the day before and the day after ovulation so that the first sperm to the egg is able to fertilize the egg. If you have sex several days prior to ovulation, the sperm are forced to wait for days for the egg, and the female sperm will still be there alive and well, and the male sperm will be dying off.
Google it - how to conceive a male, and you'll also learn tips about acidity and diet to make it easier on the sperm survival.
If you try for a girl, you have about a 60-40 chance of having a girl, trying for a boy tips the odds to about 55-45 for a boy.