Right, the Elves true time in Middle-Earth ended at the end of Second Age in the big battle we saw at the start of the first film. This was called the Last Alliance- not because man and Elf would never be friend again, but because after that battle the Elves would no longer exist as a true culture on Middle-Earth as the bulk of them would be going west.
It must be remembered that these lands to the West are the true home of MOST of these Elves. Some of them are descended from tjhose who only came back to Middle-Earth in an attempt to fight evil (and got stuck there longer than planned), some are descended from those who never made it out West- but ALWAYS intended to go there. Only a certain line of Elves (known as 'Avari', or 'Refusers'😉 never really had much interest in going.
This long delayed move back west occurred at the start of the Third Age. And it was conceptually important as well- the Third Age is the Age where MAN takes the lead, not Elves. And the Fourth Age to come after the War of the Ring is a modern age, where immortal creatures like the Elves no longer belong.
BUT. Some Elves did stay for the Third Age, of course. Some, like Galadriel, had particualr attachment to their homes. Elrond felt a responsibility for overseeing the fledgling human kingdoms since the disaster of the destruction of Numenor. Cirdan, I think, stayed in the Grey Havens just so he could oversee the transfer of Elves wishing to leave (Elves going west catch a boat from the Havens).
Eavh of these three Elven settlements, then, represents a bastion of the old times, settlements that no evil can touch until Sauron gets his Ring back where the old Elves still live. More importantly, each of these three took charge of one of the Three Elvish Rings. These Rings could not be brought west and SOMEONE, of course, had to look after them. It is on the power of these Rings that the security and power of the Elvish Havens was maintained- though to his credit, Cirdan simply gave his to Gandalf.
Now, when the One Ring is destroyed, that power goes. These last bastions of true Elvish power will fade without that power- and those Elves in them who stayed behind know that their time is finally come after all, and they must go. THIS is why the last of the Elves are making ready to leave at the time of the films.
However, there are a few exceptions. The High Elves (Noldor) may well be going, as will most of the Sindar (Grey Elves- pretty much the 'standard' Elf). However, there is still a Sindar Kingdom in the Mirkwood (of whom Legolas' father is King, who, btw, locked up the Dwarvves and Bilbo in The Hobbit) whose population have no reason to go- Legoloas only goes because he feels the calling of the sea but the rest have no need to. And there are plenty of Avari (most of whom are Silvan, or Wood Elves) around in the scattered forests (and also in the Mirkwood) who have no reason to go either. So there may yet be some remnant of the Elves, even though the suggestion is that the time for immortal beings on Middle-Earth has gone.
BTW, whilst a glimmer of future prediction is indeed a noted ability of powerful Elves (and even some Dunadain, such as Malbeth the Seer and even the father of Boromir and Faramir (didn't do him much good though)), when Elrond 'predicted' that Aragorn was going to die, he was only using his common sense- Aragorn is mortal!