Galadriel was returning to the undying lands where she was born. Gandalf was returning to retire there. He helped build them (and the rest of the world too, but the undying lands were really nicer than most of the rest of the world). A branch of Elrond’s ancestors had come from the undying lands, and he was going to live there now too.
Basically the mightiest and wisest of the elves were leaving Middle-Earth to spend the rest of Time in Valinor (The undying lands). The age of men had come. Any elves who continued to live in Middle-Earth would slowly fade. Any elf had the option to sail into the West to live in the undying lands by the end of the 4th age. But this sort of trip was forbidden to most mortals. When Arwen chose mortality, she lost her privilege to go into the West. Aragorn never had the privilege, despite being descended from Elrond’s brother Elros. Elros chose mortality for himself and all his descendants thousands of years before Aragorn was born.
Bilbo and Frodo got invited to live the rest of their lives in the easternmost part of the undying lands (Tol Eressëa, aka Avallonë) because of their spiritual wounding by Sauron via the ring. It was hoped they would heal and find peace there before dying.
BTW, the undying lands are so called because those that live there do not die. While elves may have their bodies destroyed, their spirits return to the undying lands where they may get issued new bodies; alternatively they may just hang around the halls of Mandos in spirit form until the end of the world. And the Powers like Gandalf can generally manifest a variety of physical forms.
Mortals like men and hobbits were given the gift of death. When they died, their spirits left all of creation altogether, and the elves and the Powers (like Gandalf and Saruman) don’t know what happens to them. Although reliable reports state that when the end of Time arrives, and the Battle of Battles occurs, mortals will return to kick some major butt.