Effect of duration taken to get phd degree when applying to faculty positions?
This answer reflects a North American perspective at an R1 or R2 university - answers in other parts of the world may be different.

If I saw someone who completed a PhD in two years I would want to know things like:


What work did they do before their PhD? (Did their prior experience make the PhD faster?)
What were the primary contributions of their PhD? (Are the contributions significant?)
How many of their contributions were their own versus their supervisors?
What teaching experience do they have?
How well will they work with other students and faculty?
What leadership have they taken during their PhD?


There are of course many other qualifications to evaluate and questions to be asked.

Hiring a faculty member into a research/teaching position is always a bit of a gamble that they will be able to continue to do productive research and teaching. With just two years of a PhD, there may not be enough evidence of what will happen in a long-term position, and this could hurt your chances to get a position. (This also depends on the strength of the advisor and the letters of recommendation.)

In Computer Science the approximate qualification I use for a PhD is that a student has learned to do independent research. That is, they can formulate the ideas and experiments for and write a complete research paper more or less independently. (And get the paper accepted in a top-tier venue.) I'd be looking to see evidence of this in a faculty application.

So, would a two-year PhD have a good or bad impact? There isn't a single answer. It depends on the answers to the questions above and other cultural factors. But, I would look very closely at someone who had completed a PhD that quickly, as 4-5 years might be more typical in my field.