"for' is not necessarily needed.
It can also be translated like this :
"How long do you rest?"
However, I don't know if Duolingo accepts that as a correct answer.
I prefer you translation as I have always used istirahat to mean 'rest'. Both are correct, but my dictionary list 'rest' first; and if it follows normal rules, the most popular translation should be given first.
"How long a break do you take" rearranges the words offered by the word bank to create a colloquially acceptable translation (in British English). To be truly grammatically correct though we need an "of" to give "How long of a break do you take".