The fact is, even if someone at Leica were to tell you (which I doubt they will) that the M8 will be supported for X-number of years, I would take it with a grain of salt. Just ask anyone who bought a DMR. Certain parts are unavailable (the truth being it would be too expensive for Leica to contract for a small batch of parts) making the DMR virtually unrepairable. Whatever you read about laws stipulating 7 or 10 years post-discontinuation a manufacturer has to support a product, the DMR was officially discontinued not that long ago, and no one has written of Leica being sanctioned.
The good thing about the M8 is that it shares a number of parts with the M9, including the battery. But there are plenty of other parts, including the sensor, which it does not. How long you could expect Leica to service an M8 will likely depend on what's wrong with it and whether Leica has the part it needs. Whether or not you would find it economically sensible to get it repaired is a different issue. A shutter replacement costs somewhere in the neighborhood of $700. In fact, a simple CLA runs upwards of $300. Not that many years from now an M8 will likely be worth at most $1000.
I prefer to think of buying digital cameras in terms of film and developing cost. The last time I shot film, it cost me about $15 for a 36-exp roll and E6 processing. So if I bought an M8 now for $2000, once I'd shot the equivalent of 134 rolls of film, I would consider the camera free, and if it died and either couldn't be repaired or couldn't be repaired inexpensively, I would not be terribly upset to sell it for parts and move on.