The class will be over in 10 minutes.
The class will be over after 10 minutes.
I know the first is correct but why?
The class will be over in 10 minutes.
The class will be over after 10 minutes.
I know the first is correct but why?
In OP's examples, "in" and "after" both specify a future time relative to the present moment. There's no grammatical rule saying either preposition is correct or wrong - it's just idiomatic preference that most people would use "in".
Given that "in" is a somewhat "metaphoric" usage here, I suspect there's a tendency to only use it in simple constructions where it's relative to the present moment.
When speaking of some situation in the past, there is no "present moment" - so we need to explicitly state the time/event that we're counting our 10 minutes from. In such contexts, we're more likely to use after (or within, following, etc.) because the whole situation is more complex, so we choose our words more carefully. "I went to the bar, but I left after 10 minutes".
They are both correct; although, if I wanted to be more precise, I would probably say it like this:
The class will end in 10 minutes.
Going back to your two examples: right now, class is in session, but in ten minutes, class will end, and after 10 minutes, class will have ended, (or, put another way, class will be over).
Either one can work, however, because we don't usually give much thought to the relationships between time, changes of state, and times of state transitions – not in general conversation, at least. If it's now 12:50, and class runs until 1 o'clock, we don't generally make distinctions between 1:00 (when the bell rings) and 1:00:02 (when we're in the process of standing up) and 1:00:37 (when we are walking out the door). All we really pay attention to is, "Class is done at one!"
In a scientific paper describing some low-level process, we might need to pay more attention to our prepositions, and not say "after" when we mean "in", and vice-versa. For the end of class, however, either preposition suffices.
To me, 'After ten minutes' suggests certainly not before ten minutes have passed, and might be quite a bit later. 'In ten minutes' is fairly precise but might mean a little less than ten minutes.
In this context, I believe 'in' and 'after' are prepositions because there is a time constraint. I think 'in' is used for near future and 'after' is for far future.