Do dropped items in Minecraft decay, and if so, after how long? [duplicate]
Items will disappear if they are on the ground for 5 minutes after you die. This timer starts ticking as soon as you die; even on the death screen that timer is going to keep counting, so if you go take a break to grab some food and come back to find out your character's been lying around dead for 10 minutes, your items are gone.
Also, dying in lava or fire will make you lose any items that fall into the flames. Items that fall onto cactus are also destroyed.
Caveat: if you spawn far enough away from where you died and the chunk becomes unloaded, the item timers will freeze until the chunk is loaded again.
As per this question, your inventory will stay around the point where you died for approximately 5 minutes.
If you die with creepers around, be aware that an exploding creeper (after your items have dropped) will probably destroy some/all of them.
From personal experience, sometimes the items kind of spray out around where you died, so do a few laps when you get there to make sure you got everything.