Residencies vary in length from 3 years to 7 or more (if you spend time in a research lab). A search here will turn up threads about the various residencies but here are some common ones...
General Surgery: 5+ (at least 5 years; more if you do lab time)
Internal Medicine: 3
Emergency Medicine: 3-4
Psychiatry: 4
Anesthesiology: 4
Family Practice: 3
Ob-Gyn: 4
Orthopaedics: 5
Radiology: 4
Peds: 3
While many do do their residency at the same place where they went to medical school by no means is this a requirement or even desirable or possible in some cases (ie, if you school doesn't offer the residency you are interested in).
You may be interested in the Residency Training database on the AMA website:
http://www.ama-assn.org/ama/pub/category/2997.html
FREIDA will also give you an idea of what programs are out there, there locations, etc. Bear in mind that FREIDA is not a comprehensive list nor is the information there on work hours, salary, etc. necessarily up to date or correct.
http://www.ama-assn.org/vapp/freida/srch/