It's easy to confuse the adverb awhile with the two-word noun phrase a while: the main difference between them is grammatical.
The adverb awhile (one word) means for a short time: "Stay awhile."
The noun phrase a while (two words) refers to a period of time: "I sat for a while and waited."
Also see the usage notes below.
Before removing the radiator cap, wait awhile for the engine to cool.
I haven't been to a football game in a long while.
"Awhile is an adverb, with the same meaning as the adverbial prepositional phrase for a while: Let's rest awhile; Let's rest for a while. When for a while cannot be substituted for awhile, awhile should be a while: spend a while with me. When for occurs, awhile should not follow; Stay for awhile should be Stay for a while or Stay awhile."
(Edward Johnson, The Handbook of Good English. Washington Square Press, 1991)
"As a noun, spell it as two words: a while. As an adverb, spell it as one: awhile."
(Bryan Garner, Garner's Modern American Usage. Oxford University Press, 2009)