Today, I found on reddit an interesting thread in which Trekkies share odd facts about Star Trek.* One of them is that the late physicist Stephen Hawking is the only person to depict himself on any Star Trek series. This was in a holodeck scene in the Next Generation episode "Descent."
Arguably, though, Hawking was not portraying himself, but a holographic version of himself. The Deep Space Nine character Vic Fontaine, who was a hologram, as distinguished from his Mirror Universe counterpart, who corporeal. So although Vic Fontaine is not a person, there is, in established canon, a distinction between a person and a holographic variant of that person.
The Voyager episode "Future's End," in which selected crew members travel to 1996, or the film The Voyage Home, in which the original cast travel to 1986, would have given Hawking the best opportunity for him to actually portray himself within the Star Trek universe.
*I will not, of course, share information from such a list without doing some basic fact-checking. Memory Alpha, which is a tightly-edited wiki, confirms that Stephen Hawking is the only person to portray himself on Star Trek. And I'm at a loss to think of who else, outside of stock footage, would qualify.
First example: Actor Marty Pistone played the character of "Controller #2". BUT IMDB notes the actor's name was incorrectly printed as "Martin" in the film's credit.
You'd need to find someone credited with a character name of "self" or their own name (e.g. "Ronald Regan").