In the Fellowship of the Ring, after Galadriel is tempted by the ring, she says, "I passed the test. I will diminish...and go into the West...and remain Galadriel."
What does she mean by saying that she will "diminish" and "remain Galadriel?"
At the time of the Lord of the Rings more and more of the Elven population of Middle Earth have decided to return to the Undying Lands due in part to the original rise of Sauron from which they endured heavy casualties but could not quite recover as the men of Gondor and Arnor did. The prosperity of the men in the following years while there was still a High King of those realms signified to most of the Eldar that their time on Middle Earth would soon be at an end especially as much of their own realms had been lost even before Sauron came to power such as Gondolin. With their population significantly lessened and their lack of stemming the slow decay of their influence following the death of Gil Galad would have given most Elves reason to leave.
Eregion the region where most of the Noldor Elves had populated had by the time of LOTR fallen into decay and been abandoned. Elrond ruled over the last highly populated realm west of the Misty Mountains (The Grey Havens although having an Elven population, it was far smaller in comparison and most would leave before and during the War of the Ring). Galadriel herself is probably one of the last of the strongest Elven bloodlines and one of the most powerful characters in Middle Earth at that time but having confronted the Necromancer and barely defeated him she knows that if Sauron defeated the free peoples then she could not defend the Elves with her magic Elrond mentions to Gandalf there is no strength left in the Elves to stem the darkness.
With that knowledge I think they planned to leave regardless but stayed longer than most because they could probably hold off Sauron for a short time while the remainder of their people attempted to escape. You have to appreciate that the task Frodo is sent to do, most of the free peoples believe to be suicide hardly any expected Frodo to achieve what he managed even though they had hope they doubted he would return in fact Frodo himself begins to doubt that he and Sam will survive and its only really Sam who has enough faith that they accomplish their task. Nevertheless with the defeat of Sauron most of the Elves have already departed and Galadriel would see no point in remaining when she can leave to be with her people especially as Middle Earth no longer needs her to protect the lands west of Lorien from Sauron so Galadriel I think always intended to leave as she knew she could not withstand Sauron and with his defeat she was free to be with her people again in the Undying Lands.
To add to the existing answers, I want to explain part of the significance of the first part of the quote. That isn't what you are asking about, but the meaning goes over people's heads unless they've read The Silmarillion or Unfinished Tales, so I though it would be useful to expand a bit, in case someone lands here.
Galadriel is over 7,000 years old. She was born in the Undying Lands ("the West"), and was one the leaders of the events that led the Elves to Middle Earth. She refused to return at the end of the First Age, and so the Valar barred her from returning later. Hence the significance of her statement. Not only does she think that (after millennia) the Valar will let her return, she needs and finally wants to, because the time of the Elves is passing.
This is my favorite example of how reading The Silmarillion enriches a re-reading of The Lord of the Rings. I'm really glad the film kept it too.
She's diminishing because the time for the dominion of men had come. This means she's going to be losing her position of authority.
She's remaining Galadriel because the ring won't transform her as it did for Gollum. (To illustrate what would happen if she accepted, she presented an image of herself corrupted by the ring, declaring: "In place of a Dark Lord, you would have a queen! Not dark, but beautiful and terrible as the dawn! Treacherous as the sea! Stronger than the foundations of the earth! All shall love me, and despair!").