Translation:If you are tired, why don't you go to sleep?
It's because of
wenn. It's one of those conjunctions where you must put the verb at the end of the clause.
Any clause that follows one of the subordinating conjunctions (http://german.about.com/library/weekly/aa010910b.htm).
Well, first of all, schlafen is the infinitive form of the verb to sleep, not a noun. If you removed the first piece of the sentence, you'd have "Warum gehst du nicht schlafen?"; this is the main piece of the sentence. You can't remove the "Warum gehst du nicht schlafen?" because then your sentence would just be incomplete since "Wenn du müde bist" is the subordinate clause, to complement the main clause.
"Er ist ein bisschen traurig, weil er keine Freundin hat" (He is a little sad because he doesn't have a girlfriend)
"Weil er keine Freundin hat, ist er ein bisschen traurig" (Because he doesn't have a girlfriends, he is a little sad)
I suppose "Wenn du müde bist, warum gehst du nicht schlafen?" is a bit of an exception. We can't flip the gehst to the beginning of the main clause because of warum, which is a question word and must be at the beginning of a main clause. A subordinate clause is different, however.
Take this example...
"Kannst du mir sagen, warum du so wütend bist?" (Can you tell me why you are so furious?)
It's a bit like in English. "Why are you so furious?" vs. "Can you tell me, why you are so furious?". You see that in the second one, it's not the main question, and certainly you can't say in English, "Why you are so furious?" alone. The subordinate question is not the real question since it could be replaced with, like this, "Can you tell me the reason you are so furious?", but you could never ask someone, "The reason you are so furious?". The warum basically asks like a conjunction, it seems.
I hope this helps a bit!
Wann is used for questions
-Wann gehst du rennen?=When are you going running?
Wenn is used for repeated events in the past
-Wenn ich renne, ich trinke Wasser.=When/If I go running , I drink water.
I'm still learning German myself so my translations might be a little rough lol
"Go sleeping" is not a standard phrase in English, so it does not have a standard meaning. But it is not a good substitute for "go to sleep."
If you are interested, the construction "go [verb]-ing" usually means to go out into the world to do something active. You can go hiking, go fishing, go shopping, go camping, go biking . . . There is another meaning that is harder to explain, as in the phrase, "Don't you go snooping in the closets. You'll never find where I hid the presents anyway." In any case, "Why don't you go sleeping?" isn't a natural way to ask, "Why don't you go to sleep?"
(to jogerj) No, you cannot use the word "als" in that context. "Als" has several uses - when used as a conjunction to start a subordinate clause, it means "when" in the sense of looking back to a specific time when something happened (typically the clause will be in the past tense), not "when" in the sense that is comparable to "if."
Als ich nach Hause ging, hatte ich Hunger. -- When I went home, I was hungry.
Wenn ich müde bin, soll ich schlafen gehen. -- When (or Whenever) I am tired, I should go to sleep.
So, I guess a simple way to remember the difference is, if you can say "whenever" instead of "when" and it makes sense, then you should use "wenn", not "als" or another word like "wann". (Wann only gets used in questions as far as I know.)