We know that the ring kept Gollum/Smeagol alive for about 500 years, and in The Lord of the Rings we see Bilbo aging really fast after he gave the ring to Frodo, so what happens to Gollum? He remains without the ring for 60 years: shouldn't he be dead?
So obviously this is never actually stated outright in the books or movies but it seems to be implied that when the ring came to Gollum he was still quite young and, being one of the river folk, still had a good 85 years going for him.
When he put on the ring he didn't take it off for long periods of time. he ring does not release its hold on you just because you take it off. So for all five hundred years Gollum was being influenced by the ring and whilst this was happening rather than ageing by getting older, he was ageing by becoming more and more malformed as can been seen in the montage in the begging of the third movie.
When he was finally separated from the ring he started aging normally again, by this time, whilst malformed and mutated, Gollum is still, physically speaking, very young, we can see in the movies that his fitness and strength has not deteriorated. So therefore we can assume that if Gollum hadn't had the courage to leave his cave then he would have lived there for another ten to fifteen years at least.