how long would it take to be an gynecologist
After graduating from med school you will be a doctor, but you won't be ready to practice as a gynecologist just yet. This requires another four years of residency. Residency is a form of on-the-job training for doctors. During this time you will work with experienced obstetricians and gynecologists in a hospital setting to master the field. During residency you will also attend workshops and conferences to learn from experts.
It takes (on average) 4 years of undergrad, 4 years of medical school, and 4 years of residency to become a fully practicing OB/GYN, and up to another 3 years to become a specialist. So at least 12 years. You will have to take biology, microbiology, chemistry, organic chemistry, biochemistry, etc. to become an OB/GYN.