The TVTropes Trope Finder is where you can come to ask questions like "Do we have this one?" and "What's the trope about...?" Trying to rediscover a long lost show or other medium but need a little help? Head to Media Finder and try your luck there. Want to propose a new trope? You should be over at You Know, That Thing Where.
Helpful Hallucination for the general concept. Covers the full range from proper "you probably seek medical help if this keeps happening" hallucinations to purely imagined figures representing internal dialogues and intrusive thoughts
Talking to the Dead if the other person is deceased and we're not in "explicitly literal ghost" territory (This one has a lot of inherent Maybe Magic, Maybe Mundane even in the most grounded works)
Surrogate Soliloquy if they use a prop or stand-in as the other person (Sometimes livened up by having a picture imagined to life or the owner of an item appear after the conversation begins.)
Living Memory if the other has more agency/substance, like the lingering echo of a Mental Fusion or the psychic impression of the author left in a Great Big Book of Everything. The visual aspect can be more literal here- say, the Cyber Ninja has a nanotech tattoo with an AI simulacrum of his sensei that he occasionally consults, even knowing that it's just a pale Virtual Ghost from a low-resolution Brain Upload.
Edited by Scorpion451
An on-screen depiction where one character imagines another character is there, and so you have a scene with both actors in it, but it's understood that one isn't "really" there.
Like there's a scene where Alice interacts with Bob, who died or is gone. If there are other characters in the scene, they cannot see Bob, only Alice can. This is a representation of Alice working through her thoughts and feelings about Bob and his death. It's not Hallucinations, per se. It's understood more as Alice imagining Bob, or having intrusive thoughts of "Bob would say X were he here." She knows he's not really there.