за и на - you should use the same proposition as in usual sentence, it is a question word for any quantity - time, price etc. "как долго" is used for time only when in usual sentence you don't need preposition. Examples:
Я доеду за 2 минуты. За сколько (минут) ты доедешь? I will come in 2 minutes (It will take me 2 minutes to reach some place). In how many minutes will you come?
Я заеду на 2 минуты. На сколько минут ты заедешь? I will come for 2 minutes (I will spend 2 minutes in some place). For how many minutes will you come? (sounds a little bit strange in English, I feel it :))
Я купил книгу за 100 рублей. За сколько (рублей) ты купил книгу? I have baught a book for 100 rubles. For how much (for how many rubles) have you baught the book? (Meaning - how much have you spent on it? )
Эта книга дороже на 100 рублей чем та. На сколько рублей дороже эта книга? This book is 100 rubles more expensive than that one. For how many rubles is this book more expensive? (What is the difference in prices? )
Я учу русский язык уже 2 года. Как долго ты уже учишь русский язык? I have already been learning russian during 2 years. How long have you already been learning russian?
как долго = during which period of time - can be easily replaced just with "сколько" - Сколько ты уже учишь русский язык? (though I don't guarantee it is true for all cases, it is just my quick intuition, there may be other cases).
Good luck!