A bad ending can wreck a good story or a good ending can redeem a weak one. I've seen examples of both. I've also seen endings in books and movies that have caused me to see the entire story from a different perspective, or leave me begging for a sequel, or leave me thinking. Here are some examples of what I'm talking about.
Endings that detract from a good story: Sleepless in Seattle. Just when the two main characters meet, the story ends. Total frustration. By the way, if you think I'm wrong about that, I believe Nora Ephron, the writer of Sleepless, also knew that she had a problem with the ending because in her next screenplay she fixed it. With You've Got Mail she again had the stars not really 'meet' and fall in love until the very end of the movie, but via a very clever and plausible script had them interacting somewhat romatically throughout the entire movie, and, in my opinion, produced a much more satifying romantic comedy as a result.
An ending that salvaged a weak story: Okay, I suspect not everyone will agree with me on this, but I found myself not liking the story or even appreciating the characters until the end of the movie Unforgiven. From the moment that Clint Eastwood grabbed the whiskey bottle and took that drink while standing outside the town, the movie kicked into high gear, enough to win that movie the academy award. If it had been any other ending, the movie would have been a flop - in my opinion.
Endings that changed my perspective on a story: Unknown with Liam Neeson. When I first saw that movie I spent most of it counting up the plot holes only to find, when the ending was unveiled, that all the plot holes (except for one) were, in retrospective, not plot holes at all.
Stories that left open the possibility of a sequel: The first Star Wars. Darth Vader gaining control of his ship and flying off right after the destruction of the death star sends him cartwheeling into space. Movies that left me begging for a sequel: The second Star Wars Movie The Empire Strikes Back. Hans Solo being lowered into the chamber; Luke finding out Darth Vader is his father. Priceless.
Endings that left me thinking: The Time Machine with Rod Taylor and Yvette Mimieux when we are left to guess which books the hero took with him back to the future (Back to the Future, now that would be a good title for a movie!)
So, what makes a good ending? There are no rules except one: Don't play games with the reader. Understand what you wrote, its effect on your readers, and then weave an ending that leaves your readers satified and rewarded for having spent the time and effort to read your story.
My next posting will be on where to find ideas for plots for books.