I have found that when my bags get full and I need to vendor loot I can sometimes leave loot on the ground and return to it. Other times it seems to disappear almost instantly once I leave the area. Is the loot despawn time based, based on my distance from the dropped loot, or some other factor(s)?
To my knowledge only white loot despawns (this includes things like ammunition) and while I don't know how long it takes specifically it is possible to tell by looking at it. The item steadily shrinks in size until it basically disappears. So yes, it does seem to be based on time.
I'm fairly sure items rarer than white (green, blue, purple, E-tech, orange, obviously) don't despawn. I've left them lying in open chests before and come back ten, 15 minutes later and still seen them lying there. I'm not certain about them being on the ground though, if you take them from the chest then drop them again they may have exactly the same "shrinking away into nothingness" time as white items.