You can indeed use a determiner with class here if you are referring to a specific class — my class , this class , and so forth.
Class can also be used in a non-count way, however.
Macmillan notes this under sense 2a : [countable/uncountable] education a period of time during which a group of students is taught together - in class:
We had to write an essay in class.
In fact, many nouns referring to some set, scheduled activity which preoccupies your time can be used without an article with have , where have is the sense of experiencing something (Macmillan sense 4b ).
I'm leaving the party early because I have work tomorrow.
The parish hall is closed while the contraltos have rehearsal.
My oldest son has practice until 5pm during the season.
On Thursdays we have therapy with Dr. Wong and then go out for dinner.
We never see the evening games because my family has church.
ell.stackexchange.com/users/21/choster
There are quite a number of nouns (as choster's answer indicates) which can be used with have without a determiner.
To say that we have {such a noun} refers to an item on your schedule, an obligation, a prior commitment.
But I don't think the meaning is "experiencing something" (as in I have a headache ).
I cannot meet you after school, I have soccer.
I cannot join you for brunch, I have church.
I cannot join you for dinner,
I have choir.
I cannot join you on the camping trip, I have community service that weekend.
I cannot join you on your trip to the beach, I have school.
I cannot make it, I have rehearsal.
The listener understands from the locution that what follows have refers to an obligation, a prior commitment, often a regularly scheduled one.
Sorry, I have court.
Sorry, I have rounds.
Sorry, I have kitchen detail.
You could even say: Sorry, I cannot join you.
I have Mary. and the listener would understand you to mean that you had some obligation or commitment involving Mary.
This meaning of have also accepts an infinitive clause as its complement:
Sorry, I have to go.
ell.stackexchange.com/users/10264/Tᴚoɯɐuo
It's an idiomatic expression.
While "class" (as in "lesson" or "lecture") is not, strictly speaking, an uncountable noun, in this case it's used in the same way as other uncountable nouns like "time" or "space", as in the following examples: I have time to help you with your homework.
I have space for more books on my shelves.
You can say either "class" or "a class".
"A class" would refer to a particular class you need to attend, while "class" by itself refers to the general concept of "classes I need to attend".
ell.stackexchange.com/users/42184/Andrew
As a British English speaker I suppose this sounds incorrect as class isn't commonly used in this context and would generally include the article if it was.
"I have class" sounds more like an ironic boast about how they conduct themselves.
ell.stackexchange.com/users/70203/Bytes
I can't speak to why it is, but "I have class" is a common way to say the phrase in American English.
It is more typical to say it when the person you are speaking with knows about your class, like if you are a high school or college student people tend to know you attend classes.
In the case where the audience doesn't know about your class, it would be more common to say "I have a class" which opens itself up to more conversation like "I have a class on cooking every Tuesday and Thursday night".
"Lesson" is not used the same way in American English, especially as it refers to school.
A class is typically a series of lessons.
Even a class that is one sitting that only lasts an hour could contain multiple lessons.
"I have lesson" is not a common phrase, and sounds funny.
ell.stackexchange.com/users/80621/brad
Why do people frequently say:  “Got to run, I have class!” instead of “I have  a  class!”   Why is the article missing? How can this be some “class in general since” since the speaker apparently means some particular lesson he has to attend? Is it acceptable to say “I have lesson!”?
Is it correct to say "I have class"?
ell.stackexchange.com
<articles>
ell.stackexchange.com/questions/176235
ell.stackexchange.com/users/77655/Zak
 You can use a determiner with  class  here if you are referring to a specific class —  my class ,  this class, etc. However, in can also be used as an uncountable - "I have class". This is an idiomatic expression. Class is a noun that can be used in a countable or uncountable way, and do not always take a determiner. In this case, this is an idiomatic use where it is not strictly an uncountable noun, although it uses the same structure.
Class is a noun that can be used in a countable or uncountable way, and do not always take a determiner. In this case, this is an idiomatic use where it is not strictly an uncountable noun, although it uses the same structure.