TIL that the earliest reference to the term "classical music" was in 1829 by Oxford English Dictionary. So that makes me wonder: what was this music refered to as before the popularization of the term "classical"?
First off, a couple definitions of the term "classical music." It can refer to both
The entire catalogue of what can also be called "western art music" or "serious music," depending on who you're talking to (extra snob points if the latter!)
A specific subset of that music, consisting of music written between about 1750 and 1820
Both of those are hard to define exactly, with fairly fuzzy edges. And that gets us to the disappointing answer to your question, which is that they didn't really call it one thing because it wasn't thought of as one thing.
I work at a classical music radio station. Tune us in, and you could hear a Bach chorale followed by a set of renaissance dances followed by a Beethoven piano concerto. To us, this all codes as "classical music." To someone in the 1820s, this would be the rough equivalent of playing the Beatles followed by a minstrel tune followed by Slayer. Even though you could definitely find threads and connections between those musics, you would really only group them together under a very broad category. And just like the line between the Beatles and Slayer (hey, they're both all-male groups of guitars, drums, and bass, right?), people back in the 1820s and earlier saw dividing lines where we don't necessarily see them today.
You can see those dividing lines in the names and forms of what we call classical music, even if they aren't apparent to the casual listener today. If we take Mozart as an example, we can see that his work included
Lighter music like serenades and divertimenti, intended for banquets and other gatherings.
Operas, one of the most popular musical and theatrical entertainments of the day. He also wrote singspiele, a closely related genre that incorporated spoken dialogue and was geared more towards working and middle class audiences.
Chamber music, like string quartets and Piano Trios, which were written for smaller ensembles and more intimate performances.
Larger scale orchestral works like concerti and symphonies, meant for concert halls.
This is just one composer from one time period, and already you have a plethora of genres and music written for very different occasions and purposes. Today, it might all seem like "classical music," but that's not necessarily the way it would have been seen back then.
EDIT: I just have to link one more piece from the illustrious Mozart, seen by some today as the height of class and erudition. It's a round for six voices in three parts, something that sounds like it would fit right in on a serious choral program. Except it's titled "Leck Mich Im Arsch," and you don't need to know any German to get the meaning...
Also, linking u/dragonnyxx in because this answers their followup question.
Followup question: did they have more detailed genres at the time, in the way metal fans have all sorts of subdivisions like grindcore and death metal?