Sounds like this is probably The Twilight Zone episode, "A World of His Own".
"A World of His Own" is episode thirty-six of the American television anthology series The Twilight Zone. It was the last episode of the show's first season and essentially comedic in tone. It originally aired on July 1, 1960, on CBS.
Coming home, Victoria West (Phyllis Kirk) spots her husband, playwright Gregory West (Keenan Wynn), through the window sharing a drink, and flirting in his study with Mary (Mary LaRoche), an attractive, affectionate young woman. Mr. West quickly destroys a tape, which displeases Mary. When Victoria barges into the room, Mary is nowhere to be found.
Victoria looks around the room for hints of where she might have gone but does not yet confront him. Soon, she questions him. Gregory denies everything until Victoria throws in a trick, which causes Mr. West to admit the truth. Victoria is furious, but Gregory explains to his wife that any character that he describes into his dictation machine will appear according to his description. To make the character disappear, all he has to do is cut out that portion of the tape and throw it into his fireplace. Victoria doesn't believe him and is ready to divorce him and commit him to an asylum. Gregory demonstrates his power, summoning Mary again and "uncreating" her, but not before Mary requests that Gregory not bring her back again, as she has grown weary of her segmented existence. Appalled, Victoria tries to escape, but Gregory uses his power to summon an elephant to stop her. Gregory discovered this talent when a male character he had put a great deal of effort and attention into approached him as a real flesh-and-blood person with his own independent will, shook his hand and thanked him.
Believing none of this (despite seeing and hearing the elephant), Victoria tells Gregory that he is insane and she is going to have him committed. In response, Gregory pulls a section of tape from his safe and explains that it contains her description, revealing her to be one of his creations, but that recently she has begun to exert her own independence from him. Refusing to believe him, Victoria snatches the tape away from him and throws it into the fire, and promptly begins to feel faint. "You don't mean you were telling the truth?! You were right!" she cries, and disappears as the flames consume the tape. Frantic, Gregory rushes to his dictation machine and begins to re-describe Victoria. He quickly reconsiders and instead describes Mrs. Mary West as his wife. Mary reappears and fixes her husband a drink, apparently lacking any memory of her previous interval of existence.