Years. I think it's been 4-5 years since I got my Phantom P3P and it's still going strong (the one I didn't lose in the sea, that is -- I had two). The batteries are still good too.
It will depend a lot of factors, like how much down time you have per year due to weather. I am just below the N48th parallel, so I don't fly much in the winter. But if you're much closer to the equator, you may get in more hours per year than I do. You also may take hiatus periods that have nothing to do with weather (job, life, etc.).
The batteries have a finite life, so follow the recommendations re: storage that you keep reading about here to extend their life.
Other things wear out too, such as the motors, especially if you fly in a dusty / dirty environment. Replace props when they're damaged.
So if you keep replacing batteries and motors, it could last a very long time.
Anecdote: I was flying on a jetliner once and wondered aloud how old the plane was. The guy next to me knew the aircraft type and typical maintenance and said something like "It's old enough that critical parts such as the engines and landing gear have all been replaced. The fuselage, on the other hand, could be very old". That made me worry.
Chris
PS The DJI Phantom 3 ACs had problems with shell cracks (early shells were replaced free of charge, but older ones still had issues). I have mine touched up with super-glue at points that display stress-crack growth. I have not heard that the Mavic has that kind of problem though.