When you are sleeping, your calorie consumption also goes down--which you could easily go without eating for a longer period of time than you would if you were awake. Not the best example since Link was out for seven years, but a lot of mammals hibernate in the winter using this concept. They just gather a bunch of food to last them enough calories throughout the entire season. Going completely dormant is pretty effective, in this sense. I suppose since we never see Link eat, I can't necessarily say this is why. Unless his Kokiri Tunic has chlorophyll in it and that provides him his energy... (Well, the Kokiris are connected to the forest and as far as I'm concerned, it should have some sort of ability like the others. The photosynthesis-performing tunic... xP)
Oh, but when "logic" doesn't serve an explanation, it is probably magic. The entire Golden Land is enchanted, so if he is sealed away, he probably is being watched over and protected. Also, this game is about time-travelling. Think about how when Link plants the Master Sword back into its pedestal, it sends him back to the past. It probably just sends his mentality to the future. He doesn't remember anything from the seven years in between because he wasn't there. He skipped it entirely.