I am writing a short story which features a character known only as Old Man, but there is a part of the story where someone calls the Old Man by his name. Only once, and I was wondering if there was a way to have it so that the name is said but not mentioned in the story. My story is written from the third person.
Sure, take the example of the Library story arc in Doctor Who, we see River Song tell the Doctor his name by way of convincing him she's trustworthy but we don't hear it. The audience only know what she told him because she says she's going to tell him and only know it's the right name because of the Doctor's reaction to it. The same is possible in written fiction as well:
X leaned over and whispered into the Old Man's ear. The colour drained from his weatherbeaten features, then he found his voice. "But how do you know that name?" he sputtered.
Or something similar, the key is to show the information being used without actually saying what that information is.
Have the narrator tell the action in that place, not show it. Then show Old Man's reaction.
"Nothing gives you the right to do this."
Old Man sat back down in his chair, hoping Taylor would take the hint and go. Instead, he bent over so close Old Man smelled beer and onions on his breath. Then Taylor whispered something Old Man had last heard from his wife's dying lips. Too many years to count.
"How?..." Old Man asked him.
Taylor stood. "I know more than you think. More than just your name, Old Man."
And so on...
Note: This answers a slightly looser requirement that "the real name is not mentioned in the story". This isn't precisely what the OP asked, and may not work for them, but may suit others in a broadly similar situation.
You could perhaps adopt/adapt the technique used in the spy novel The Ipcress File by Len Deighton. Although the film of the book gave the main character a name (Harry Palmer), Deighton did not. At one point in the book he has another character refer to the protagonist by name (while in an airport bookshop):
I was killing a minute with the paperbacks when I heard a soft voice say, 'Hello, Harry.'
Now my name isn't Harry, but in this business it's hard to remember whether it ever had been.
and "Harry" shrugs it off as a previously-used false name. That works well for a cloak-and-dagger spy story, but there are variants you could use in a more run-of-the-mill setting, for instance:
Old Man didn't know why [she | certain people] had decided his name was "John": it wasn't, but he couldn't be bothered correcting them.
Note: The technique Deighton uses keeps it clear to the reader that they don't know the name of the main character: he has not been named up to this point in the book, and as soon as a name is mentioned, it is immediately made clear that it is not the character's real name.
This is in contrast to, say, The Day of the Jackal by Frederick Forsyth. Here (spoiler-block for anyone who has not read the book):
The main character is identified early on – both to characters within the story and to the reader – as Charles Calthrop. While we [the reader] see him assume many false identities throughout the book to evade the authorities, we "know" he is Charles Calthrop. It is only in the epilogue that this certainty is disabused and we learn that neither we, nor the authorities, know his real name.
I'd imagine, the Old Man is one of the central characters of your story. Why not name the story after him and use his name there?
Doing so would accentuate his stature while creating an air of mystery. Allowing one person to called the Old Man by his name also conveys depth and sensitivity.
I'm not sure if you've got a short story title in mind but I would simply call it "John" and leave it at that.