I will give answering this question a shot...others can feel free to disagree.
A general surgery residency comprises general surgery as well as some surgical subspecialties. So, you learn pretty much all gastrointestinal surgery (cholecystectomies, hernia repairs, colectomies, gastrectomies/gastric bypass, the list goes on) as well as cardiac (valves, bypasses, etc), thoracic (lung resections, etc), vascular (aneurysms, vascular bypasses, amputations, etc), plastics, pediatric surgery, and surgical oncology. I am sure something is missing, but I think I covered most of it.
A general surgeon in practice will do mostly GI surgery and breast surgery (lumpectomies and mastectomies, etc). In some geographic locations general surgeons do some of the subspecialty surgery as well. A graduate of a general surgery residency is free to subspecialize in cardiac, thoracic, vascular, plastics, peds, surg onc by doing fellowship training.
Other surgical subspecialties have their own residencies. These are orthopedics, neurosurgery, ENT, and urology. These residencies typically do 6 months-2years of general surgery prior to entering their subspeciality residencies (which vary in length). Residents from these programs are also free to do fellowships for additional subspecialty training.
Hope this helps.