Normally 4 years for a phd. and 2 for a masters. however if you're slow on your thesis, you might take longer, or very rarely, less (unlikely).
there's also the special case of phd without a masters, where you're bumped into a phd program after your first year in the masters program