To have your head in the clouds means that your thoughts are not on the task at hand. Your thoughts are elsewhere, as if they are floating in the clouds, not firmly planted into the soil. Ex.: "Keep your head out of the clouds and concentrate on finishing this essay! You can't keep your grades high if you don't finish your homework on time!" This is admonishing a student to focus on the task before him (an essay) rather than think about other subjects, perhaps more enjoyable ones.