"How long do we have?"
Solution 1:
Both sentences are equally correct in a conversational context. Alternatives that are slightly less colloquial:
How much time remains before class?
or
How soon will class start?
or
How many minutes (or hours) do we have before class starts?
Solution 2:
Neither of OP's exact phrasings occur often enough to graph with NGram, but this similar pair shows that how long is a standard form.
In OP's example, both forms are perfectly valid. The difference is that how long implies the undesirability of having to wait if the delay is in fact "long", whereas how much time implies the desirability of there being sufficient time to do something else before class starts.