A doctorate usually takes a year or so of courses, a few qualifying exams to prove you know your stuff, and an indeterminate number of years doing research and writing a small book about it called your thesis. The last part is done when it is done... but in total 4-10 years is probably a good estimate. Think 6-7 years on average.
3 - 4 years from when you start your PhD some people have masters degrees, some go in straight from a bachelors. In the UK funding is usually only for 3 years, so if you go over that you have to fund yourself. The last year is usually used to write up your thesis.
I should have pointed out that PhD's vary by country, and I'm from the US. (Looking for some actual statistics, I might have overstated the situation a bit as well... it looks like the median time is more like 5-6 years, not 6-7.)