Pecans whether shelled or not shelled usually last for 6 months as long as you keep the pecans in the refrigerator.
If you want to keep the pecans longer than 6 months you can freeze the pecans and the frozen pecans will last in the freezer for up to 2 years.
When pecans are left out at room temperature flies can actually start laying eggs in the pecans which has happened to me.
Then when those flies lay eggs in the pecans they then lead to maggots in the pecans which is basically like little white worms.
Those maggots then eventually turn into more flies.
So keep the pecans in the refrigerator or at least in a sealed container or sealed bag to keep any flies away from the pecans.
The pecans should also last at room temperature for up to 6 months.