1. For whom do you work so hard?
This sentence is grammatically correct and might be used by a native speaker of English.
2. Whom do you work so hard for?
'Whom' cannot be used here since 'Who' is the subject of the sentence.
Many teachers are of the opinion that ending a sentence with a preposition ('for' in this case) is ungrammatical. Others consider it acceptable in informal speech. No matter whose opinion you accept sentences ending with a preposition do sound clumsy and unpolished. I would suggest you avoid them whenever possible
3. In which class are you studying?
This is a grammatical sentence but it seems a bit unnatural to me.
Should it be:
'In whose class are you studying?' or
'In which classroom are you studying??'
4. Which class are you studying in?
See my comments above with respect to sentences ending in a preposition. They apply here as well.
Student or Learner