I am trying to find the title and author of this SF short story:
I believe you're thinking of "The Possessed" by Arthur C. Clarke (first published in Dynamic Science Fiction, March 1953, available at the Internet Archive), although the details don't all match.
An alien ship and crew become stranded on pre-human Earth. While their ships can take advantage of wormholes, a rescue beacon is limited to speed-of-light and will take many centuries to reach "home."
This is the part that doesn't match: no spaceships, wormholes, or beacon in Clarke's story, and the aliens have no home to return to. A Swarm of immaterial beings, some sort of mind-parasites, are seeking a new home, as their home star has exploded:
Six cold outer worlds had already been searched and discarded. Either they were frozen beyond all hope of organic life, or else they harbored entities of types that were useless to the Swarm. If it was to survive, it must find hosts not too unlike those it had left on its doomed and distant home. Millions of years ago the Swarm had begun its journey, swept starward by the fires of its own exploding sun. Yet even now the memory of its lost birth-place was still sharp and clear, an ache that would never die.
The Swarm arrives at Earth. Unfortunately (for them):
Everywhere it found life, but nowhere intelligence. There were things that crawled and flew and leaped, but there were no things that talked or built. Ten million years hence there might be creatures here with minds that the Swarm could possess and guide for its own purposes; there was no sign of them now. It could not guess which of the countless life-forms on this planet would be the heir to the future, and without such a host it was helpless--a mere pattern of electric charges, a matrix of order and self-awareness in a universe of chaos. By its own resources the Swarm had no control over matter, yet once it had lodged in the mind of a sentient race there was nothing that lay beyond its powers.
The Swarm divides:
At last it made its decision. By its very nature, it could choose both alternatives. The greater part of the Swarm would continue its travels among the stars, but a portion of it would remain on this world, like a seed planted in the hope of future harvest.
They leave a message with the beacon explaining, so the rescue ship can recover a sufficient number of the small Earth creatures to rebuild the alien individuals' personalities, and program the small Earth animals to return to the beacon each year in the hope that a rescue ship has arrived.
Not exactly, but:
There was a last exchange of thoughts between parent and child who were also identical twins. If all went well with them both, they would meet again in the far future here at this valley in the mountains. The one who was staying would return to this point at regular intervals down the ages; the one who continued the search would send back an emissary if ever a better world was found. And then they would be united again, no longer homeless exiles vainly wandering among the indifferent stars.
They know that they cannot survive in Earth's environment until rescue arrives, so being superb biologists they pick an inconsequential but plentiful Earth animal with a reliable brain and somehow "implant" themselves into it's genes.
The search was long and the choice difficult, but at last the Swarm selected its host. Like rain sinking into thirsty soil, it entered the bodies of certain small lizards and began to direct their destiny.
It was an immense task, even for a being which could never know death. Generation after generation of the lizards was swept into the past before there came the slightest improvement in the race. And always, at the appointed time, the swarm returned to its rendezvous among the mountains. Always it returned in vain: there was no messenger from the stars, bringing news of better fortune elsewhere.
And at last:
Somewhere in the labyrinth of evolution the Swarm made its fatal mistake and took the wrong turning. A hundred million years had gone since it came to Earth, and it was very weary. It could not die, but it could degenerate. The memories of its ancient home and of its destiny were fading; its intelligence was waning even while its hosts climbed the long slope that would lead to self-awareness.
Over the eons, this being a young and active planet, Earth's land and water has shifted and the beacon is now underwater, a few miles off a coastline.
Only one thing remained--the blind urge which still, at intervals which by some strange aberration were becoming ever shorter, drove it to seek its consummation in a valley that long ago had ceased to exist.
We learn at the end of the story that still each year those small animals nearby are triggered to return to the beacon, and the lemmings throw themselves into the water in that futile attempt, not knowing why.
Obeying an urge whose meaning they had never known, the doomed legions of the lemmings were finding oblivion beneath the waves.