Board cert. Surgeons train 5-7yrs gen. Surgery then 2-3 yrs speciality training...I don't get it, do doctors choose length of programs or is it random?

Not random. The length of the program is determined by the specialty certification boards who have determined that this is the length of time necessary to insure that doctors have adequate training. During this time the doctors work long hard hours under the close supervision of their teachers while also participating in the training of medical students & less senior doctors. It takes a lot of dedication!
Depends. The system of training physicians and surgeons is complex, but generally speaking, the length of the program is determined by the specialty board. General surgeons are certified by the american board of surgery, which requires a five year residency in general surgery to qualify to sit for the exams. Other specialties will vary in length of time. Neurosurgery requires 7 years.