I don't "just know," either, and I have great trouble with it. So... I have trained my vet, who knows that I want to keep my pets happy for as long as possible.
All other things being equal, if it seems really hard for Rover or Fluffy, I am likely to ask, "If this were your pet, what would you do?" Then we'll discuss it, and we may come up with a new treatment idea to try. Or, conversely, the vet may say, "It's time, and this is why."
At our house, we've had cats live until they were twenty, and sometimes they do look pretty rough and they sleep a lot, just like elderly people. If one year of a cat's life is five years of a person's life, as is sometimes said, then an eighteen-year-old cat is getting close to the century mark. Personally, I have to go by the kitty's attitude. If an elderly cat acts, well, elderly, that's all right, and I give him extra time and extra attention - and sometimes extra cleaning up. But that same cat may have a good attitude, and I try to consider that and take it one day at a time. There's nothing wrong with passing away of natural causes.
Get some Kleenex before you read this story. My DIL was given a kitty when she was twelve, and when she married my son the kitty was getting up in years. He's in the Army, and when he was away in Iraq the cat started really acting as if her age were catching up to her. My DIL didn't know what to do, but gave the kitty the extra care that was needed. It turned out that her cat was waiting for my son to come home; she died comfortably the day after he returned, curled up in his lap.
Sometimes there are surprises. One of my cats had a very hard year in his middle-to-old age (not as old as your kitty!), with several serious problems which were hard on him. He seemed to be struggling, and my vet was starting to make those "quality of life" remarks, when I realized that as uncomfortable as my kitty was, he showed no signs of *wanting* to die - he wanted to live. He was adjusting to his condition better than I was. So I said, "Let's just back off. I'll keep taking care of him and medicating him, and we'll see if he stays happy." And he did - for several more years, until he died of old age. So sometimes we both learn a good lesson.
This is a happy result of patronizing the same veterinary office for years and years; I trust them and they trust me.