A general rule of thumb for spaying and neutering is the younger the better. They only exception is giant breeds where owners should discuss their pets individually specific needs with their vet prior to surgery. As young as 12-16 weeks and at least 2 lbs.
Female dogs and cats
Male dogs and cats
Just because you spay/neuter your pet DOES NOT mean that they will get fat! But their metabolism slows down with the decrease in hormones and their daily intake of food must decrease by 30%