Similar in meaning to saying "I'll sleep when I'm dead!"
Something a failing high school/college student says when they pull an all-nighter while they stay up studying for finals.
Student: I NEED TO STUDY!
Mother: Ok honey, just make sure to sleep well so you don't fall asleep while taking your test!
Student: Mom, are you crazy?!? I'LL SLEEP WHEN I GRADUATE!