In deadly circumstances. Near death. Living dangerously. ‘Borrowed’ implies that one should have died, perhaps from disease or having done something to create an enemy, either way you remain alive but unknown for how long. (Compare to At death’s door, Kiss of death, Not long for this world or One foot in the grave.)
“The vet said our dog is real sick and just living on borrowed time.”