In many cases the names of Star Trek planets correctly follow the planet naming conventions established in science fiction decades before TOS was first broadcast. In other cases they fail to follow the science fiction conventions accurately.
Many of the few thousand stars which can be seen from Earth without telescopes, which are a tiny fraction of all the billions of stars in our galaxy, have proper names in one or more Earth cultures.
I own a copy of Star Names Their Lore and Meaning, by Richard HInckley Allen, 1899, 1963, which spends hundreds of pages listing and discussing the names of various stars in differnt cultures.
Many stars also have designations in various catalogs.
In 1603 a man named Bayer printed a star atlas with maps of the sky. And in it he printed new designations beside most of the stars. Each Bayer designition consisted of a lower case greek letter and the genitive case of the constellation's name in Latin.
Since most people don't recognize Greek letters, it is now very common to spell out the Greek letter in a Bayer designation. Thus a constellation like Centaurus will have stars with Bayer designations of Alpha Centauri, Beta Centauri, Gamma Centauri, Delta Centauri, and so on down to the last letter in the Greek alphabet, Omega, as in Omega Centauri.
With some constellations Bayer ran out of stars before he used all the Greek letters, and with other constellations Bayer ran out of Greek letters before he got to all of the stars.
In the 18th century a star catalog by Astronomer Royal John Flamsteed gave Flamsteed designations to the stars listed. All the stars "in" a constellation were numbered in order of right ascension, followed by the genitive case of the constellation's name in Latin. So the star Omicron2 Eridani is also known as 40 Eridani (and is probably the star that the planet Vulcan in Star Trek orbits).
There have been tens, and hundreds, and thousands, of other star catalogs created since then, listing tens of thousands, hundreds of thousands, and millions, of other stars, most of which can be seen from Earth only through telescopes.
And usually a star, in a star catalog, is listed with the name of the catalog or an abbreviation of that name, followed by its number in the catalog. And many stars have several different catalog designations.
Here is a link to Wikipedia's List of nearby Stars and brown dwarfs, which lists them out to a distance of 5 parsecs, which is a little over 16 light years.
So, you should read the list of stars and look at their designations, and also note that many of them have more than one designation listed (and they may have others which are not listed there).
Some of them are listed under proper names, (and also have Bayer designations) such as Sirius (Alpha Canis Majoris) and Procyon (Alpha Canis Minoris).
Others are listed under their Bayer designations, such as Alpha Centauri, Epsilon Eridani, Tau Ceti, and Epsilon Indi.
Some are listed under their Flamsteed designations, such as 61 Cygni and 40 Eridani.
And most are listed under their designations in many different star catalogs.
In the early 20th century science fiction became a separate genre with its own conventions. Space opera stories about interstellar travel often had spacemen visit alien planets which orbited distant stars. Sometimes those planets were nameless, sometimes Earth explorers gave them names, and sometimes the names used by native intelligent beings were used.
And sometimes the stars which those alien planets orbited were mentioned. Sometimes they were stars known to Earth people with Earth designations including proper names, Bayer designations, Flamsteed designations, catalog numbers, etc. And sometimes those stars had imaginary names given by Earth explorers, or names given by any natives their planets might have.
And science fiction writers developed another system of referring to alien planets. They would call them by the name or other designation of their star followed by numbers in the order of distance from their star. And those numbers are sometimes written out and sometimes given as Roman numerals.
So, in our solar system Mercury is Sol One or Sol I, Venus is Sol Two or Sol II, Earth is Sol Three or Sol III, Mars is Sol Four or Sol IV, Jupiter is Sol Five or Sol V, Saturn is Sol Six or Sol VI, etc., sometimes extended to as yet undiscovered planets in the solar system.
This may have been suggested by the practice of giving the many moons of the giant planets Roman numerals.
For example, There are a number of such planet designations in E.E. Smith's Lensman series. As one example, in Second stage Lensman (1941-42, 1953) there is a star named Trallis in the Second Galaxy. Two of its planets are important in the plot, Tralle (Trallis III) and Onlo (Trallis IX).
In the last 30 years or so astronomers on Earth have discovered over 4,000 exoplanets orbiting around other stars. The usual designation practice is different from that of science fiction writers; the planets are given lower case Latin letters in order of discovery, so the first planet discovered orbiting a star is (Starname) b, the second planet discovered is (Starname) c, and so on.
The various writers of Star Trek episodes were and are more or less familiar with the naming practices of science fiction, and so their star names and planet names follow science fiction conventions to a greater or lesser degree.
This article at the ex Astris scientia website discusses the star names in Star Trek and how well they agree with real star names.
Anyway, this is why some planets in Star Trek are known by names, and some by names and numbers.