Out of interest do you mean, "how many years until a new Playstation4 is released?" which will undoubtedly put the Ps3 in the same league that the Ps2 is now, or "how many years are Sony supporting the Ps3 for?" as I am guessing that the lifespan of the console is different depending on which question you use.
As I tend to switch machines as a new one is released and don't look twice at the old machine even though support is still there.
as far as I know 2012/13 a new PS will be out giving the console in my eyes a 3/4 year lifespan. But as posted above support will probably end in 2016 giving it another 7 years.
Well, look at it this way, games are still being released for the PS2. Iirc there's even been some exclusives (Persona 4 springs to mind which is arguably better than all of the JRPGs released for the 'next-gen' consoles). I can't see any reason why the PS3 won't receive the same sort of support.