Is one of the following forms correct?
- For how long will you play the guitar?
- How long will you play the guitar for?
If none of these questions is grammatically correct, how should I formulate it?
Actually, the best variant of all is without the "for" since it is redundant as duration is already implied in "how long."
How long are you going to be playing the guitar?
Option 1, in the spoken language, would sound affected and pidginish.
Option 2 is more colloquial and common.
The question can mean (at least) two different things:
AS A HABITUAL ACTIVITY
If you mean the second option (habitual activity), I would say or write:
How long will you play the guitar?
Notice I have dropped the for, which is unnecessary.
The expected answer is something like "For ten years." or "All my life." or "Until I get to university, but then I will have to give it up because I will be too busy."
But, another way to ask this question regarding a habitual activity is to ask:
How long do you intend/plan to play the guitar? or remove the the, and ask
How long do you intend/plan to play guitar?
(Note: one can also use this construction if someone is playing the guitar right now. But this would normally mean that you want them to stop playing, because it is bothering you or the guitar-player has something more important to do.)
TO REFER TO PRESENT OR IMMEDIATE FUTURE
But if you want to ask someone who is already playing or about to start playing the guitar, I would say:
How long are you going to play the guitar for?
And since I am asking the question, I would use gonna 99% of the time:
How long are you gonna play the guitar for?
If the guitar-player has the guitar in hand already, then I would eliminate the definite article the, since one assumes the guitarist is going to play the guitar that she or he is holding or has nearby. I would also drop the for, because it has become noticeably redundant and unnecessary:
How long are you gonna play guitar?
Which is a good orthographical representation of what I would teach an English language learner to say.
How long'r ya gonna play guitar (for)? Notice the for might creep back in, just to balance the rhythm of the question. But I would still probably resist using it:
How long'r ya gonna play guitar?
Both are correct. There is a much-debated rule about not ending sentences with prepositions, like "for". As a result, some people would say that version 1 is more correct. They may or may not be right about that.
I think that's what you're asking, but since "where" could also mean "in what situation" as well as "in what location", permit me to provide the following summary.
Remember that English questions are usually a rearrangement of an equivalent statement, with some part replaced with an interrogative ("how", "what", etc.) "For" should appear in the question if it would appear in the statement.
How long will you play the guitar for?
I will play the guitar for an hour.
Whom will you play the guitar for?
I will play the guitar for my girlfriend.
What will you go shopping for?
I will go shopping for a guitar.
If you want to know when to use "for" in a statement, well, it's a little bit complex. "For" precedes indirect objects of a verb, when they're a time period (first example above), a beneficiary (second example), or a goal (third example). There may be other categories that I haven't thought of.