The cap for dropped items is 400. Once there are 400 items on the ground, the oldest items start being removed by the newer items. You're unlikely to hit the cap outside of an invasion, Solar Eclipse or Moon event.
If you're playing single player, all dropped items are cleared upon save and quit. In multiplayer, all dropped items are removed when the server/host quits.
Lava destroys all items with a grey or white rarity. (A few items with white rarity are an exception and can survive a lava bath.)