That can vary depending on things like whether you are funded and what the arrangement is. My PhD funding is for three years, which is pretty standard now, and my supervisors are very much gearing me up to think of it as 'three years and not a day longer', because then I'd be into unfunded time. The reality is that most people take longer than three years, though. I think some universities are now putting a limit of four years in place. (I am talking about UK PhDs).