how long can I keep uncooked lentils in my pantry?
Lentils are good for a long time: Many claim that they stay safe "indefinitively".
While that is clearly an exaggeration, properly stored lentils stay edible for years if you keep them well-sealed in a cool, dry and dark(-ish) place.
Note that dry storage keeps mold at bay, closed jars protect from insect damage and cool temperatures slow trace amounts of fat getting rancid. They might get tough and a bit stale, but that can be mitigated by cooking longer and a generous hand when seasoning.
To add one source (for completeness):
Still Tasty gives one year but states that it doesn't get unsafe, simply looses taste.
Normally, what I would do is keep them in an air tight container and stash it in the fridge. Once in a couple of months, I would take them out to dry again in the sun for a few hours and back in the fridge. The longest I kept was a year and it was still good. Tip: If you have successfully kept it for a decade, check whether it would germinate or not. If it does, it's good to eat. Haha.