Avoid going to bed with headphones on (presumably playing music).
There are plenty of articles online and on headfi detailing exactly how and why this is dangerous for your hearing. Repeat: dangerous.
In a very crude summary an argument against wearing headphones whilst asleep goes as such. When the body decides to rest and enter a state of unconciousness, muscles all through the body rest, relax and enter different states compared to what they are when we're awake. This includes the muscles in and around the ear obviously. Now, during the day these muscles work in a way to protect our eardrums from excessive loud noises which would otherwise, if the muscle wasn't functioning, cause hearing/ear damage. It also works in other ways to protect, monitor and control volume levels of incoming sound..... .....I hope you can see where this is going now..........When we are subconscious and asleep, so too are (to a degree) these muscles.
I'm not sure what the exact implications are of using iem's (at normal/loud volumes) when sleeping- but I can't imagine them being positive.