"A while" is a noun phrase and "awhile" is an adverb phrase.
Examples:
Please, stay a while. (Just imagine replacing a while with another noun, in this case...
Please, stay a few minutes.)
I practiced awhile. (Here, awhile modifies practiced, letting you know you practiced for an undetermined but significant time.)
I agree with Bill, "awhile" is rarely used in modern English.