Yes, I want to underline this.
Seven years total at my school is not uncommon (we get 1 or 2 students who do it per year). Since our 3rd and 4th years are compressed into 15-18 months, this translates into 3.5+ years of research.
I'm going to grad in 2007 with 7 years total, and for me and most of the other students I know who did this it was very heavily PI-dependent. We all had PIs who were independently motivated to get us out quickly.
Often, your typical PhD involves some number of years slaving away on an ambitious but unsure project that gives you nothing but negative data. For a few lucky people, these projects eventually work out. More commonly, there comes a point when the PI takes pity on you and directs you/allows you to direct yourself towards something less exciting but more reliably fruitful. This can happen at pretty much any point during your training. If your PI doesn't care about getting you out, it might happen at year 5 or 6. If your PI is motivated to get you out, it might happen at year 2. Most of the PhD students I know (myself included) say they got 90% of the data for their theses in their last six months to a year of research.
Other things that are helpful are either knowing the field/lab very well already (as others have mentioned), or choosing a field in which data are generated at a rapid and/or highly controllable rate. These fields include fly/worm genetics, human functional imaging, theoretical/computational biology, and epidemiology (where you set the length of your study at the beginning). Stay away from mouse genetics (can take years to generate a mouse) and primate in vivo recordings (can take a year to train the monkey).