Guru and Vayu bring the image from Dwaraka
This is the origin story told for Guruvayur. We have not yet found it in a Purana or in the devaswom's own published history, so it is told here as it is commonly told, and its details may vary.
As Dwaraka, Krishna's city, is about to be taken by the sea at the end of his life on earth, an image of Vishnu that had been worshipped there must be saved. In the common telling the charge passes, through Krishna's companion Uddhava, to Guru — Brihaspati, the preceptor of the gods — and to Vayu, the god of wind.
The two recover the image from the water and look for a place to install it. They travel south. In the land that is now Kerala they come to a lake where Shiva is found, and Shiva tells them that this is the place for the image.
The image is installed there. The town takes its name from the two who brought it: Guru and Vayu, and ur, a place — Guruvayur.
In the same telling Shiva withdraws to the far side of the water to make room, which is how the nearby Shiva shrine at Mammiyur is tied to Guruvayur.
What the story explains: the name of the town, and the belief — reflected in the title Kerala Tourism gives the temple, the Dwaraka of the South — that the deity here came from Dwaraka itself. The deity is worshipped as Guruvayurappan, the lord of Guruvayur.
Kerala Tourism confirms only the Dwaraka-of-the-South title and that the main image of Krishna is housed in the garbhagriha of the sreekovil. The rest of the story still awaits a written source, such as the Guruvayur Devaswom's published history or a Purana chapter.
Where this account comes from
We have not yet found a text we can cite for this account. It is told here as it is told locally, and marked unverified.