Short answer: It depends, and it varies by the type. "Starfish" isn't a very specific term, after all.
Taking extremes, some cannot survive any significant exposure to air; even a few seconds is lethal -- crown-of-thorns can easily rupture on exposure to air and leak all their body fluids out rapidly. Others, such as ochre stars (a common species on the Pacific Northwest coast of North America) pump themselves full of seawater and then cling tightly to a rock with their hydrostatic tube-feet, retaining water as a heat sink and simply waiting out the high tide. Even species that aren't especially resilient to air exposure may take days to fully die, despite having undergone lethal exposure.
Thanks!
Anyone know how long a starfish can survive on land, and if it matters especially whether there is a hot sun.
I promise this will turn out to be (at least somewhat) important and Less-Wrong relevant. Googling for the answer gives me a bunch of "wiki-answers" type sites that I don't trust and news articles that don't give me the specifics. If anyone either has marine-biologist cred, or better google-fu than me, I'd appreciate it.