A carved pumpkin will last around a month. But it also depends on how much you have carved out. If you carve a lot out it will go rotten faster. But if you never carve anything out of the pumpkin it...
If the can isn't damaged (dented or puntured) and the lid isn't puffed up, it's probably good. If the can is damaged it will go bad. Other than that it should be good for a couple of years.