I slept on top of my iPhone 5 last night. Does that ruin the phone?

Will it heat up the phone or ruin it?

The only way that would ruin it of it was on the entire time then it would overheat other than that it should really be a problem I sleep on my electronics all the time by accident and they've worked fine for years.

No! Don't worry. This situation happen with me a couple of times ago and my iPhone Still works perfectly.

It shouldn't cause a problem at all unless you damaged the screen. Phones are designed to withstand temperatures a lot higher than your own body temperature.