On September 29th, 3018 TA, Frodo Baggins and his three halfling companions arrive at the Prancing Pony in Bree, and are accosted by the Ranger, Strider, who saves them from a nighttime attack by the Ringwraiths. They also find a letter from Gandalf, whose whereabouts are unknown.
On that same evening Gandalf, who has escaped imprisonment by Saruman, speaks to Sam’s father Hamfast Gamgee, and learns that Frodo has left The Shire.
In 3021, Bilbo and Frodo, joined by Gandalf, Galadriel and Círdan, leave Middle-earth, sailing west presumably to Tol Eressëa, off the shores of the Undying Lands.
Contrary to what some say, Bilbo and Frodo do not become immortal by traveling to the Uttermost West. But in Valinor their wounds, caused by the One Ring and in Frodo’s case by the Morgul blade of the Witch-king, will no longer trouble them.
This latter date also marks the end of the Third Age, and the beginning of the Fourth.
Samwise, who also briefly bore the One Ring, travels to Valinor 62 years later.