Videogames:
I really liked Final Fantasy X's ending, especially after watching some of the hidden dialogs you see when going back to the temples and meeting the various Fayth. It is a sad ending, but at the same time it wonderfully continues the theme of the game that death is not the end, and that there is a better world waiting for those who do not run away from it.
I also rather liked the bittersweet ending of Wild Arms 4.
Also, Vagrant Story and Breath of Fire: Dragon Quarter both had very good endings, but I guess in these cases it might be simply because they are resolutions to extremely good stories.
Anime:
I need to give mention to G Gundam, simply because they managed to top a wonderfully over-the-top series with an even more over-the-top and wildly fun final sequence, even to the point of resolving the serious and dramatic elements of the story early in order to pull out a shamelessly fun ending.
I also really like the ending to Eureka 7, simply because it ends the series in the same spirit that series had followed from the start, and ends with the final recognition that the hero has grown up and become a better person because of everything that has happened. I think it is a great series as a whole.