Ok, you are talking an inkjet cartridge. But it still can get tricky, because there are two types of inkjet cartridges. (1) A type where the printhead is on the cartridge itself. (2) A type where the cartridge is really just an inktank and the printhead is external to the cartridge.
(3) Beyond that, we can talk about an OEM never used cartridge or a refilled cartridge where the ink may dry up on the printhead on the cartridge.
But going by standard advice for any of those three choices, almost everyone, OEM or aftermarket, usually says the shelf life is two years and the better ones will guarantee there cartridges for that period.
But there is an additionally worry with some cheap refill inks, namely a fungus can break down the stored ink if storage temperatures are on the high side.
And I close with some advice for any cartridge with a printhead on the cartridge you may think is still full but does not print, first clean the printhead with water, then place into a sealed zip lock bag, and briefly immerse in 150-160 degree F water. It can often get the most stubborn cartridge to start printing.