It doesn't seem to stay indefinitely, and it seems that the rarity of the item might have an effect on how long it stays around. As far as actual times, there doesn't seem to be any consensus on the internet as to the specific time it takes for items to disappear. Here's a link to a discussion on the same topic: gamespot.com/borderlands/forum/…
–
A. StillMay 29 '12 at 16:34

The first two adjust the time certain loot is kept around, and it depends on whether an item is short-lived (money) or long-lived (Orange weapons).

The last one is the time-to-shrink setting. You have noticed that some loot starts to shrink before it disappears entirely, right? The default is 15 seconds, I believe. I have set it to 1 second at times, and the stuff shrinks and disappears very quickly.

My observations...

Each item type has a different setting for whether it's short-lived or long-lived. Money seems to disappear first. White weapons disappear before green which disappears before blue... and so on.

The overall lifetime of loot appears to adjust on an as-needed basis. If there is a ton of loot hanging around - hundreds of items - then loot will start to disappear sooner. I suspect this is done to keep the engine from over-loading.

When opening hundreds of chests in my test map, white weapons would disappear by the time I opened two more chests. By the time I opened the last chest, only purples and oranges remained, and only in about half the chests.

In the end, loot should stick around for at least 5 minutes as long as there isn't too much loot littering the ground.

Good loot, like Legendaries, should stick around for a half hour. Again, as long as there isn't too much loot littering the ground. But since all that other, lesser loot will disappear first, the good loot should remain for quite a while.