With regular cleaning, a gun should last long enough for you to pass it on to your grandchildren.
Basic gun care is so simple that there is really no excuse for neglecting the chore. (Of course, if a part on your firearm breaks, you'll likely have to entrust the repair job to a competent gunsmith ... but, generally, routine maintenance will be up to you.)
The two factors that most often cause a gun to wear excessively are rust and abnormal use. You can easily prevent oxidation by wiping the device's metal parts with a cloth dampened in a lubricant such as Break-Free, an excellent all-purpose cleaner/lubricant/rust-inhibitor that actually exceeds military specifications. Wipe your gun thoroughly, but don't soak it in the lubricant, because any oil that accumulates in cracks will attract grime.
You can also apply Break-Free to the inside surface of the barrels with a cleaning rod and a wire bristle brush of the same gauge as the weapon. (Such tools can be purchased from sporting goods stores and gun dealers.) Finally, for getting dirt out of crevices in the tool's action, nothing beats an old toothbrush! (If you live in a humid climate, you'll probably need to clean and oil your firearm once a month. Less frequent attention is necessary in arid locations.)
Repeated use shouldn't damage a gun, as long as the correct size of ammunition is fired and obstructions are removed from the barrels before the weapon is discharged. However, slamming the action shut will cause undue wear, so you should close it gently. Give your firearm the same respect you'd have for any hand-fitted piece of precision machinery. It's also important to clean a gun after each practice session ... and wipe down the metal whenever you've handled the firearm, to remove the acidic body oils that may cause rust.
If you care for it properly, a gun that you buy today should be working perfectly when your grandchildren are old enough to shoot it!