There have been many gems, crystals and precious stones in the various Star Trek series and movies over the years, mostly incorporated into costumes, ceremonial jewellery and religious artifacts rather than being actual plot devices.
There was also once a mobile game called
Star Trek: The Wrath of Gems, which sounds a bit like the movie
Star Trek II: The Wrath of Khan.

In the actual movies themselves, the only gems that I can think of off the top of my head are part of costumes. Ilia had a gem like device implanted into her neck after she had been absorbed by V’Ger. Though technically, this may not have been an actual gem, it was some form of sensory/communication tech…

Sarek, on the other hand, wore a costume adorned with many gem like precious stones in
Star Trek 3: The Search for Spock and
Star Trek 6: The Undiscovered Country.

We could include Dilithium crystals as being a gem? In which case,
Star Trek 6: The Undiscovered Country had some scenes set on Rura Penthe, a Dilithium mine where we clearly see some of this crystalline/mineral in its raw form.