In my case, my PhD took about 4 years and it was the average for that PhD program. There are some PhD programs that can be shorter (e.g. 3 years) and some that are longer. But basically, most of the time the length depends on your research work and the time that you put. I ever meet a man in my home country who took 10 years to complete his PhD due to his slow research progress. This is an extreme case.