I think in a general sense, a good relationship is a relationship where you can flourish and grow, and that brings you happiness and not pain. If a relationship ends, for it to be good I would say it should be a mutual decision and the people shouldn't hold grudges against one another, even if they never see each other again they should stay on a positive note and memory of one another.
For me personally, I prefer long-term, however if a relationship needs to end for whatever reason, I wouldn't consider it a failure if it ends positively and on good terms.
I haven't had many relationships: I've had casual sex, one friend with benefits, my husband and my boyfriend. The last two are ongoing. So I don't have the experience to talk about relationships that have ended, really, because I pretty much don't have them.
I definitely think a relationship can be still going on and be a bad one, while stopping it "in time" could allow it to stay a good one. So time isn't the only or main factor to me.
I think... Think of it as jobs. You can have a short internship that brings you a lot, personally and professionally. Or a long-term contract that leaves you stagnant and unfulfilled. I think the same kind of things is possible with relationships.