Augusto,
*They are both correct. Although in the first sentence the "for" should be placed at the beginning in formal speech or writing. In everyday conversation people often place a preposition at the end of a question.
examples
-For how long are you studying English?.......How long are you studying English for?
-To whom are you talking....... Who are you talking to?
-For whom are you looking ?....Who are you looking for?
*If someone is studying now and you want to know for how much longer, you can use the present continuous to express the future.
-For how long are you studying English?....meaning the person is studying now and you want to know for how much longer they are planning to study.
-For how long are you going to study English....meaning...what is the person's intention... In this case there is no practical difference between "going to study" and "are studying" (between a plan and an intention).
-For how long will you be studying English....means in the future or from this point on, how long will you be studying?
At the library a friend approaches and says, "A few of us are going to the bar, would you like to come along?
-I would like to but I can't. I'm studying English for the exam tomorrow.
-How long are you studying for? ( How long are you planning to study?)
-For at least another hour.
-Stop by afterwards. I'm sure we will still be there.
-Ok, I'll do that.