Deuteronomy 5:10 ..."To those who keep His commandments...God's grace is extended to a thousand generations", Rashi's comment suggests when obeying out of fear. Deuteronomy 7:9..."Those who love Him...it is extended to thousands of generations", Rashi's comment suggests when obeying out of love for God. If a generation is reckoned 25 years, we're talking of 25,000 years (a thousand) or more (thousands). Will we have off spring in olam haba or will Israel last that long on this earth ?
The Chatam Sofer asks your question on Exodus 20:5, which promises reward to thousands of generations, based on the Gemara (Rosh Hashana 31a) that the world will only last 6000 years, which isn't long enough for thousands of generations to pass.
He quotes the Shoshanim LeDavid, based on the Bahag, who answers that a generation can be as short as 2 years long. The Chatam Sofer isn't satisfied with this answer because the 26 generations from Adam until the giving of the Torah were clearly longer than 2 years. Also, the three or four generations of retribution in the preceding verse are literal generations, because (as Onkelos translates) this only applies if the sons continue to act like their fathers.
His own answer is a very cryptic hint to the shemittah. I don't understand exactly what he means, but I can only guess that he's hinting to something along the lines of the Rikanti (Parashat Behar) that the world will last for additional years corresponding to the yovel (seven shemittot) or even a "great yovel" of 1000 generations.