Adventuring equipment requires maintenance to remain usable.
D&D's rules don't really cover the rate at which things decay. The Player's Handbook p.157-158, "Lifestyle Expenses" does note that equipment is expected to be maintained:
Furthermore, expenses cover the cost of maintaining your equipment so that you can be ready when the adventure next calls.
You need a modest income (1 gp/day) to reliably maintain your equipment, and a comfortable income (2 gp/day) to ensure that you can "easily" maintain your equipment. It's thus established that adventuring equipment needs to be actively maintained to remain reliably usable.
There aren't any specific rules on how long something can survive without being damaged, which traditionally means it's up to the DM. If you are the DM, you may be aided in your judgement by researching the age and condition of various real-world archaelogical finds. It's likely to vary considerably depending on the type of item.
Precious metals survive well. To this day, people in Britain dig up coins from the Roman era, and in good condition. Some silver coins are more tarnished than this and may be damaged. Copper tarnishes easily, and gold less so.
Organic materials survive less well, particularly when exposed to damp, mold, and so on. This article describes wooden chests surviving from the Middle Ages in Europe which have survived reasonably intact for hundreds of years, and some from the much drier climate of Egypt surviving thousands. Paint, varnish and such are able to improve the longevity of wooden objects.
Iron and steel sometimes survive. YouTube historian Lindybeige owns a mail shirt dating back to 1688 and captured at a battle in what is now India. When he acquired it, it was extremely rusted and needed a certain amount of cleaning and restoration, but he was able to make it wearable again.
Leather or boiled leather might be eaten by hungry rats or other creatures. I've heard it said that during the Siege of Jerusalem (or one of them, at any rate), some of the defenders resorted to eating their hardened leather shields as they contained some nutrition.
If the DM doesn't know how long something would realistically survive in a dungeon, they can always make it up, based what seems reasonable. D&D tends to assume that however old the dungeon's contents are, things like wooden doors, chests, treasure and so on have survived. Books, scrolls and other seemingly very biodegradable things have canonically survived upwards of a century in D&D adventure modules. Fictional materials may also exist which survive the elements much better than real-world counterparts, such as hardy types of wood, alchemical treatments, or dwarven metallurgy.