In The Lord of the Rings itself, there is no clear evidence of a ban. Tolkien came up with this later and published it in The Road Goes Ever On. The ban is not mentioned in detail in The Silmarillion because all of Tolkien's drafts of its ending were written before Galadriel existed.
Galadriel was a character created for The Lord of the Rings, after the story of the first age had already been more or less finalized. Tolkien struggled with how to back-insert her into The Silmarillion, and changed his mind many times.
Let's look at four different versions of the story of her ban against returning to Valinor. 1) From LotR itself, 2) From texts Tolkien himself published in 1967 3) From the Silmarillion itself, of which this part was last updated by Tolkien in 1937, and 4) From Tolkien's final thoughts in the last couple of years of his life.
1. The Lord of the Rings
In the Lord of the Rings itself, the text is ambiguous as to weather or not there was a ban on her sailing west
when she rejects the Ring,... she says: ‘I pass the test. I will diminish, and go into the West, and remain Galadriel’ (p. 366,1: 381). This suggests that she believes she has the option to return to the West, and yet her song of farewell to the Fellowship of the Ring ends with the words: ‘But if of ships I now should sing, what ship would come to me / What ship would bear me ever back across so wide a Sea?’ (p. 366,1: 381). This may be a symbolic question, for she surely knew about the Grey Havens, but it might indicate that there was a prohibition against her return to Valinor.
Hammond & Scull, The Lord of the Rings A Readers Companion (2005) - Book II Chapter 7
Christopher Tolkien is of the opinion that at that time The Lord of the Rings was written his father had not yet conceived of the ban. He says this based on the existence of an outline of Galadriel's life written shortly afterwards which makes no mention of the ban, but instead offers other reasons for her staying.
it was for love of Celeborn, ‘who would not leave Middle-earth (and probably with some pride of her own, for she had been one of those eager to adventure there)’, that Galadriel did not return into the West, and that later in the Second Age ‘she deemed it her duty to remain in Middle-earth while Sauron was still unconquered’ (Unfinished Tales, pp. 234, 240).
ibid
2. J.R.R Tolkien's later published works
While Tolkien did not have the ban in mind while writing The Lord of the Rings, he had left the text ambiguous enough that he was able to fit it in later. His conception in 1967 was that Galadriel was the last surviving leader of the rebellion of the Noldor, and thus had a special ban on her coming back, which was only lifted because of her opposing Sauron and rejecting the ring.
Unlike Tolkien's previous stages of post-LotR development, this wasn't confined to his private notes, and was actually included in published books and can be seen in a letter he wrote at the time.
The question Si man i yulma nin enquantuva? and the question at the end of her song (Vol. I, p. 389), What ship would bear me ever back across so wide a Sea?, refer to the special position of Galadriel. She was the last survivor of the princes and queens who had led the revolting Noldor to exile in Middle-earth. After the overthrow of Morgoth at the end of the First Age a ban was set upon her return, and she had replied proudly that she had no wish to do so. She passed over the Mountains of Eredluin with her husband Celeborn (one of the Sindar) and went to Eregion. But it was impossible for one of the High-Elves to overcome the yearning for the Sea, and the longing to pass over it again to the land of their former bliss. She was now burdened with this desire. In the event, after the fall of Sauron, in reward for all that she had done to oppose him, but above all for her rejection of the Ring when it came within her power, the ban was lifted, and she returned over the Sea, as is told at the end of The Lord of the Rings.
J.R.R. Tolkien, The Road Goes Ever On (1967)
The Exiles were allowed to return - save for a few chief actors in the rebellion of whom at the time of the L.R. only Galadriel remained. . . . At the time of her lament in Lorien she believed this [the ban] to be perennial, as long as Earth endured. Hence she concludes her lament with a wish or prayer that Frodo may as a special grace be granted a purgatorial (but not penal) sojourn in Eressea, the Solitary Isle in sight of Aman, though for her the way is closed. .. . Her prayer was granted - but also her personal ban was lifted, in reward for her services against Sauron, and above all for her rejection of the temptation to take the Ring when offered to her. So at the end we see her taking ship.
Letter to Mr Rang, August 1967
3. The Silmarillion
The ending of the Silmarillion last revised by Tolkien in 1937, before he even began working on The Lord of the Rings (and so before Galadriel existed). When Christopher was editing the book for publication he was very limited in what could be changed without requiring substantive rewrites. The 1937 text already had a passage about Elves staying in Middle-earth, and so Christopher just added a mention of Galadriel to the paragraph. Christopher did this in a way that fit with the already published story from The Road Goes Ever On.
Yet not all the Eldalië were willing to forsake the Hither Lands where they had long suffered and long dwelt; and some lingered many an age in the West and North, and especially in the western isles and in the Land of Leithien. And among these were Maglor, as hath been told; and with him for a while was Elrond Half-elven, who chose, as was granted to him, to be among the Elf-kindred; but Elros his brother chose to abide with Men.
J.R.R. Tolkien, the 1937 Quenta Silmarillion, published in The History of Middle-earth V - The Lost Road and Other Writings
Yet not all the Eldalië were willing to forsake the Hither Lands where they had long suffered and long dwelt; and some lingered many an age in Middle-earth. Among those were Círdan the Shipwright, and Celeborn of Doriath, with Galadriel his wife, who alone remained of those who led the Noldor to exile in Beleriand. In Middle-earth dwelt also Gil-galad the High King, and with him was Elrond Half-elven, who chose, as was granted to him, to be numbered among the Eldar; but Elros his brother chose to abide with Men.
Christopher Tolkien, The 1977 published Silmarillion (added words are in bold)
4. Tolkien's final thoughts
In the final years of his life Tolkien again returned to the question of how to better fit Galadriel into the first age, and came up with a series of new ideas. None of these made their way into the Silmarillion material, and Christopher felt it would have been too difficult to work them in.
- 1971: Galadriel was already offered a pardon at the end of the first age, but refused it.
I think it is true that I owe much of this character [Galadriel] to Christian and Catholic teaching and imagination about Mary, but actually Galadriel was a penitent: in her youth a leader in the rebellion against the Valar (the angelic guardians). At the end of the First Age she proudly refused forgiveness or permission to return. She was pardoned because of her resistance to the final and overwhelming temptation to take the Ring for herself.
Letter to Ruth Austin, January 1971
Pride still moved her when, at the end of the Elder Days after the final overthrow of Morgoth, she refused the pardon of the Valar for all who had fought against him, and remained in Middle-earth. It was not until two long ages more had passed, when at last all that she had desired in her youth came to her hand, the Ring of Power and the dominion of Middle-earth of which she had dreamed, that her wisdom was full grown and she rejected it, and passing the last test departed from Middle-earth for ever.
J.R.R. Tolkien, very late philological essay
- 1973: Galadriel was actually innocent, and not a part of the revolt
Galadriel was ‘unstained’: she had committed no evil deeds. She was an enemy of Fëanor. She did not reach Middle-earth with the other Noldor, but independently. Her reasons for desiring to go to Middle-earth were legitimate, and she would have been permitted to depart, but for the misfortune that before she set out the revolt of Feanor broke out, and she became involved in the desperate measures of Manwë, and the ban on all emigration.
Letter to Lord Halsbury, August 1973
In Fëanor's revolt that followed the Darkening of Valinor Galadriel had no part: indeed she with Celeborn fought heroically in defence of Alqualondë against the assault of the Noldor, and Celeborn's ship was saved from them. Galadriel, despairing now of Valinor and horrified by the violence and cruelty of Fëanor, set sail into the darkness without waiting for Manwë's leave, which would undoubtedly have been withheld in that hour, however legitimate her desire in itself. It was thus that she came under the ban set upon all departure, and Valinor was shut against her return.
Christopher Tolkien's summary of a note of his father's from August 1973
Finrod and Galadriel (whose husband was of the Teleri) fought against Fëanor in defence of Alqualonde.
Marginal note added to the typescript of the Annals of Aman in August 1973
Tolkien died on September 3rd 1973 and his notes about Galadriel fighting back at Alqualondë is assumed to be his last writing on Middle-earth.