how long can you keep uncooked lentils - red and brown
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.