The longest, by far, was the investigation into former Housing and Urban Development secretary Henry Cisneros. That investigation outlasted Cisneros’ 1999 plea deal and subsequent 2001 pardoning by President Bill Clinton by five years. On average, the length of an investigation was about 1,154 days. Excluding Cisneros’s, the average was about 911 from appointment to the final report.
Meaning that, if that latter average holds, the Russia investigation might be expected to end some time in late November 2019. (The median is only 668 days, for what it’s worth.)
As the Cisneros example makes clear, though, there can be indictments and prosecutions well in advance of the end of the special prosecutor’s tenure. Consider, too, the investigation into Whitewater, that ended up with Clinton’s 1999 impeachment trial. That investigation didn’t technically end until 2002.