- Do you know what time class starts?
In grammar books, this construction is called an indirect question. The inversion between auxiliary and subject is only in the first clause Do you (know), ...?
The embedded direct question is: What time does class start?
It's also possible to add the preposition "at" but it feels redundant to my ears
- Do you know what time class starts at?
- Do you know at what time class starts?
The definite article can be omitted, I don't know why, but it looks and reads more natural. To clarify further, the definite article (the class) in the OP's examples is not wrong and in speech it would barely be stressed but in writing, it looks too busy for my taste. As to correctness and formality? All three are correct and all three strike me as being neither formal nor informal. A slightly more informal way of asking would be:
- What time does class begin/start?