I believe your quote came from Robert Frost's poem (Stopping by the Woods on a Snowy Evening).
The woods are lovely dark and deep
But I have promises to keep
And miles to go before I sleep
And miles to go before I sleep.
Literally, miles to go before I sleep means that the speaker needs to travel to a far place before he can rest. It implies the need to journey long distances before sleeping.
Figuratively, there are many interpretations of this poem by Frost. Others may disagree, but personally, I think this talks about life being a JOURNEY and that sleep can be interpreted as DEATH. One may say that there is a long journey to go before the final rest.
I HOPE MY ANSWER HELPED YOU! ^^