This is one of the most difficult, and most important, questions to answer. When we discuss quality of life, we want to take into account physical and cognitive/emotional realms. These can be difficult to assess because what we see depends on the individual, and every pet's context is different. Unfortunately we are also subject to biases, particularly when it comes to our loved ones and the pain, guilt and shame associated with loss.
As a general rule, veterinarians in the field strive to "be a little early rather than a second too late."