There's no canon mention of this. Novels have followed two leads: John M. Ford's Final Reflection as well as the FASA RPG material of the day suggested dilithium was first identified in the early 23rd century (that is, a couple of decades before TOS) on Deneva, the colony mentioned in TOS "Operation: Annihilate", and that starships before that time did exist but were inferior in almost every respect because they couldn't use antimatter powerplants. A competing reference is found in the Star Fleet Medical Reference Manual, an early cooperation of later Trek "big names" Mandel, Drexler and Fredrickson: it says dilithium was found in 2049 on Jupiter V, which might be an oddball way of referring to the fifth moon of that planet.
Now, Jupiter currently has dozens of small companion rocks called "moons", and just a couple of large spherical ones. Currently, the fifth acknowledged moon is the innermost spherical one, Io. That volcanic hellhole is a likely candidate for finding exotic minerals all right, at least in the scifi sense...
Both the novel references could be "true" in the sense that dilithium might have been discovered in 2049 in the Sol system (among other places) but its properties only first understood in the 2230s at Deneva. However, the Final Reflection reference must now be considered "untrue" because ENT shows that the properties of dilithium are already well understood by mankind in the 2150s already.
If one wanted to createnovel continuity where none really exists, one might say that John M. Ford's novel refers to the first-ever discovery of natural dilithium crystal lumps, the sort that are being mined in "Mudd's Women", while the earlier use of dilithium was of an "industrial" variant, of microscopic crystals that are embedded in a paddle-like matrix as in "Alternative Factor"...
Timo Saloniemi