I am confused about the following sentence. I know it is correct to say "When will you be leaving?" But I don't know why they use "will be leaving" instead of "will leave." Can we say "When will you leave" instead? What is the difference in meaning between these two sentences, and when should I use one vs. the other?
I don't think that there is any difference at all. The only difference is that "When will you be leaving" is a bit longer and has a bit more weight. But actually I don't see any reason why I should use the infinitive in the continuous form.
If someone is moving to a new job, or going on holiday, or making a business trip, and the answer will be "Sometime next week," "In a month or two," then you might ask,
"When do you leave?"
"When will you leave?
If you expect a precise answer, "At six o'clock." "At seven to-morrow morning," then you would be more likely to say,
"When will you be leaving?"