Depends on specific apps, but you have several years at least. I’m typing from my iPad Air 5 running iPadOS 15. Compatibility is still good.
I have been running original versions of iOS since 2011. I reckon you have at least three years of pure comfort. Four-five years and you might have to seek some workarounds and you might struggle somewhere. Six major versions behind and you would probably encounter significant compatibility issues.
I have a 9.7-inch iPad Pro running iOS 12. That one is mostly incompatible today, with many websites failing to load and many apps either failing with a pop-up to update or outright loading a blank page.
I reckon you have 3-4 years of no issues at all, however, like I said. The only issue you may have before then is that of installing newly released apps. I recall that one of my first incompatibility issues with my Air 5 was the Apple-released app Freeform, launched in December 2022 and requiring the then-latest iPadOS 16.2. My Air 5 was a little over three months old (purchased August 2022), and it was running (and still runs) iPadOS 15.6. Apart from that, all is well.