I haven't seen RotK yet, but I know that in the book Gandalf says that since Sauron's time is ended, so too is his. That's why Gandalf goes, because men no longer need him to fight against Sauron.

As for Frodo going, but not Sam, I don't have a clue on that one. I know that Sam wears the ring briefly in the book, and probably in the movie.

I think that in the book there's a longer period of time between when they get back to the Shire and when they leave on the boats. In fact I think it was years. Didn't Sam have children already when Frodo and the rest left for the boats? Maybe that's why Sam didn't go. I heard the movie skipped a large part (the cleansing of the Shire).