Suppose two characters have sex in-game. What are the rules for determining if a character is pregnant, how many kids there are (single birth, twins, triples, etc), and the gender(s) of the child(ren)?
You are looking for the Book of Erotic Fantasy.
Yes, many will tell you that D&D and sex should not mix, they are right. But we don't always do what's right, right? More often than not, someone will see another playing asking the GM "Are there whores in town?", leading to some quick randomization of fun events that will make (nearly) everybody at the table laugh.
While the topic certainly deserves some degree of caution, actually integrating it into a role-playing game is difficult to implement and tends to end badly if you are not prepared and open-minded about it.
Well, that 3rd party book has several sexual related rules for your games. You don't have to use all of them, or any of them. But some are interesting to read (or it was, back in early 2000s). It has several random tables to figure out things like the size of things, gender of things and how certain races will breed with others. It also has several topics that are interesting, like how to integrate sex into your games without it turning into a joke, how certain topics should be discussed with your players, and overall, it offers a mature view on the subject.
Just for the record, the book is not the worst rules splatbook released for 3.5 (and there are many in that category), and the flavor can certainly be adjusted to your tastes. Before the game was even released, it had drawn so much criticism due to the topics being discussed that Wizards revoked their d20 license and they had to publish it under the Open Gaming License instead.
Regardless of that, the book did open up a door for people to discuss sex in d&d, something normally and often frowned upon, like the excellent articles about Pregnancy and Consent from Kismet's Guide to Sex and Romance in Fantasy Gaming.
You will also find homebrew rules for pregnancy on dnd wiki, but those are nowhere near as interesting.
When Real Life meets DnD
Science time! (Note: I have encountered this as a DM myself)
So, IRL birth is a lot about law of probabilities. You have the female. Her egg will be in different positions (or not present at all) at different times of her cycle. Depending on fertility, she may or may not have produced more than one egg. These are both somewhat random factors determined by so many minor bodily functions that, overall, even modern medical professionals see it as at least partly chance.
Now the male. He will be...ahem..."giving" thousands or even millions of sperm cells in one mating. These cells, however, have to travel what, for their size, is a super-marathon. They don't have a guaranteed chance of actually encountering an egg. That's a bit of probability right there.
So, success of the mating in the first place should be a d100 Roll. As a DM, if the creatures are of the same race/breed and quite healthy, I generally say that any roll over 20 is success. If of a different race/breed or of "meh" health but logically still capable of mating I say that any roll over 40 is success. For really odd combos, unhealthy participants, or other factors that would logically affect it I will set it anywhere from 50 to 90. A totally impossible combination should just be forbidden from success. What constitutes each of these tiers is up to you.
Now, back to science.
Eggs produced determine the number of offspring. So this is also a die roll. Unless otherwise stated for this race in the flavor text ("XYZ mothers usually give birth to four offspring" or the like), as you are both characters assume the standard for humans and set the limit at triplets. Roll a d3 to determine the result.
Lastly, gender. This is a fairly simple d2 roll for each of the potential kids (assuming they had any).
The bigger issue
If these two lovebirds (or more illicit situations) are of the same race, you're good.
You don't make it clear, but generally we assume any humanoids with actual living bodies could mate. As a DM, you have to consider what you plan to do if they AREN'T of the same race.
Generally speaking, there are a few results:
1) Dominant bloodline. If really odd races are in play, you can rule that one bloodline is dominant genetically and entirely overrules the other, making the kids the race of that parent.
2) Unearthed Arcana Bloodlines. If one of the races/beings covered by the "Bloodlines" section in UA is in play, you could choose to use a base race and add a bloodline to it.
3) Hybrids. There are some hybrids listed in DnD -- Half-orc, Half-elf, etc. For races that don't have a hybrid, there is always the option of homebrewing one yourself from the two races involved (or creating something new from the combination, perhaps).
The Pregnancy Itself
Don't forget kids aren't born instantly. Make sure you account for the pregnancy of the mother. Usually 9 months long and progressing as it goes, this carries health factors, limitations, and dangers with it.
The mother, for example, should at some point experience random bouts of the nauseated state. Base land-speed should drop some, as well as carrying capacity. Certain types of damage (or over-exertion) should also come into play as potentially harming or killing the fetuses, resulting in a miscarriage.
Even the act of giving birth is something that should be handled carefully. Births are not always successes and often killed the mother and/or babies involved. That's something that you would need to address as a DM personally, however, because the medical/healing abilities available would determine the risk.
My own experiences here as a DM
I, in general, try to have my players at least avoid this. I would suggest explaining the potential impacts on them in game first so they realized the difference it makes.
That said, if you/they decide to go ahead, I've found it works well. I used in one aristocracy/feudal campaign for players that had family bloodlines and whatnot. The nice thing is that the pregnancy itself serves as a deterrent for future acts of the same kind. Creating new characters has a major plot impact, and is something you should seriously consider.
Out of humor I do tend to use this with Don Juan bard players...and usually results in a good bit of fun by the end of longer campaigns.
Generally, avoid true hybrids. These are drastically unpredictable when the events happen, and can result in totally broken offspring. I use the hybrid effect for rather simple beings usually, or ones that are very close together.
Also, don't be afraid to use DM Omnipotent miscarriages. More than once I have ensured an NPC did not give birth successfully because I knew it would negatively affect the plot.
Lastly, consider the impact of family. This can have cultural, social, and financial impacts on a character, and unless your campaign and players are ready to handle this I suggest against pregnancy entirely. Just DM rule that they are unsuccessful.