It varies, and always has. My father’s PhD was in history; he essentially wrote a book on an aspect of the American Civil War. He obtained it before I was born, so I have little idea of what it was about. He went off to do other things.
My mother’s is in biochemistry. She studied the structure of an enzyme called liver alcohol dehydrogenase, which is found in most mammals and metabolizes alcohols. She did a lot of studies on horse livers, which meant that she was constantly storing horse livers in our downstairs freezer! I think hers took perhaps 2 or 3 years, tops.
In the sciences, as the OP noted, the length of time depends on the success of your research.
Fortunately, I pursued computer science. Though many important advances in computers have come out of pure research (and continue to do so), an equal number have come from BSCS (or less) students working in industry. My thought is, why slave in a university to get a piece of paper, when you can do the same work and get paid for it!
For that matter, not all scientists do experiments, either. The work which looks likely to form the core of my thesis is examining a set of models other theorists have proposed to explain certain phenomena, and (I hope) showing that there’s an internal inconsistency in the models as the currently stand (you’ll forgive me for being vague, here, since I haven’t actually published this particular work yet). About the closest thing this project has to an experiment is the observation “The Universe exists.” (you’d be surprised how much kilometerage a theorist can get out of that observation, and ones like it).