There's so much variability it's difficult to answer. Overall the original Panasonic crank unit has been the champion for longevity with units running well at up to 10 years old with no maintenance whatsoever. But there's been a very small proportion that have failed with one of four known possible faults. The newer version also appears to have very high reliability, but it's only been around up to five years and most on the road are much less old than that. However, those known possible faults were designed out of it so it's promising.
The Suzhou Bafang hub motors can often last a very long time and many thousands of miles, but they are also prone to failure of the internal nylon gears. Apart from the odd faulty new one that fails very early, they mostly get past 5000 miles without trouble and can do a multiple of that in the best cases.
But there's more to this than simple reliability. Those nylon gears on the SB are easily and cheaply replaced and periodic greasing extends their life, but a failed Panasonic unit has no official repair, just expensive replacement of the whole unit at around £500, though the first two years is covered with a cast iron warranty. You can see these put a different light on matters.
The Heinzmann and original Powabyke motors can last many years, but their brushes do have to be replaced from time to time, a routine maintenance matter though.
Many of the motors on the market today are just too new to be able to say, only time will tell.