Dogs can start having litters at 6 months old and it is usually recommended to sterilize dogs around 6 months old to prevent unwanted litters. 

Even if your pet is an indoor-only pet and you feel sterilization is not required, remember this:  In an emergency situation such as fire, flood, break-in, door left open, storms, moves, medical emergency, or other unexpected event, your "indoor-only" pet may bolt out the door or be accidentally left or placed outside.  These events happen every single day. ~SNC

If you own cats there are very little options in regards to sterilization due to the fact that cats are highly affected by their sex hormones which leads them to spray urine to mark territory, males will seek out fights, Cats will attempt to escape the house in order to find mates unless spayed or neutered. Cats are at a greater risk of disease when left with their reproductive organs due to fighting and sexual behavior. Once a cat is spayed/neutered these behaviors are dampened down if not completely eliminated. To prevent litters it is best to spay by 4 months and no later than 6 months to prevent these sexual behaviors from ever surfacing. It is never too late to spay or neuter your cats.
There are a few long-term health benefits for sterilizing your pet. Spayed females have a lower incidence of mammary cancer than intact females if spayed before the first heat.  Uterine infections, including pyometra which is a serious,  life-threatening infection of the uterus, common in older intact females is prevented due to the uterus being removed. Older dogs who are left intact are at a greater risk of pyrometra and the only way to treat it is by emergency spay.