First you need a bachelor's degree (4 years). then a master's degree (1 to 2 years) and then you go for a PhD. The length of time it takes to get a PhD varies based on the specialty you want. Study hard and you'll succeed.
It depends: My path was BS (4 years) , Masters (2 years), PhD (3 Years).
There are a lot of BS/MS combo degrees that are 5 years now. There are also a lot PhD programs that include a Masters in the package (6 to 7 years give or take)
If you really want to try to nail down a number, I'd say 4 for undergrad and anywhere from 4-8 on average for doctorate. So split the difference and say 10 years.