I heard a radio drama many years ago
"Something for Nothing" is a short story by Robert Sheckley, first published in Galaxy Science Fiction, June 1954, available at the Internet Archive (story starts on page 55). Also available at the Archive, the X Minus One radio adaptation aired on April 10, 1957 (this also available on YouTube).
about a man that is down and out
Definitely not prosperous:
But had he heard a voice? He couldn't be sure. Reconstructing it a moment later, Joe Collins knew that he had been lying on his bed, too tired even to take his waterlogged shoes off the blanket. He had been staring at the network of cracks in the muddy yellow ceiling, watching water drip slowly and mournfully through.
[. . . .]
Out of the army, Joe had avoided work, for which he was psychologically unsuited. He had drifted around, hoping that some fabulously wealthy person would be induced to change his will, leaving him Everything.
in (I think) a Times Square hotel.
I don't know about the Times Square hotel, but he is in New York City when the story begins:
First, he would get the machine out of New York—upstate, perhaps—some place where he wouldn't be bothered by nosy neighbors. The income tax would be tricky on this sort of thing. Perhaps, after he got organized, he should go to Central America, or . . .
. . . suddenly, a machine appears. It is shiny and from the future; called something like MC4000
Collins knelt to examine it. The machine was about three feet square and it was humming softly. The crackle-gray surface was featureless, except for a red button in one corner and a brass plate in the center. The plate said, CLASS-A UTILIZER, SERIES AA-1256432. And underneath, WARNING! THIS MACHINE SHOULD BE USED ONLY BY CLASS-A RATINGS!
He thinks that he is having his wishes granted by this machine when everything he asks the machine for appears; including a huge marble mansion.
The rest of the day, Collins reclined on a couch and drank iced beverages while the Maxima Olph Construction Company materialized equipment and put up his house.
It was a low-slung affair of some twenty rooms, which Collins considered quite modest under the circumstances. It was built only of the best materials, from a design of Mig of Degma, interior by Towige, a Mula swimming pool and formal gardens by Vierien.
By evening, it was completed, and the small army of workmen packed up their equipment and vanished.
The machine, as it turns out, is not an "Aladdin's lamp" as he supposed, but a "credit card" from the future
"You are laboring under a misapprehension, sir," Flign said with quiet dignity. "The A-rating does not represent a social group, as you seem to believe. It is merely a credit rating."
"A what?" Collins asked slowly.
"A credit rating." Flign glanced at his watch. "We haven't much time, so I'll make this as brief as possible. Ours is a decentralized age, Mr. Collins. Our businesses, industries and services are scattered through an appreciable portion of space and time. The utilization corporation is an essential link. It provides for the transfer of goods and services from point to point. Do you understand?
"Credit is, of course, an automatic privilege. But, eventually, everything must be paid for."
and he owes many millions of dollars!
The total came to slightly better than eighteen billion Credits.
Of course he can't pay it, so he is sent to a debtor's work prison where all day he slaves extracting marble from a quarry [. . .] "and there is always some sucker ordering a Marble Mansion."
"This is a pick," the man said patiently. "And over there is a quarry, where you and I and a number of others will cut marble."
"Sure. There's always some idiot who wants a palace," the man said with a wry grin. "You can call me Jang. We'll be together for some time."
Collins blinked stupidly. "How long?"
"You work it out," Jang said. "The rate is fifty credits a month until your debt is paid off."
. . . expresses solace to a fellow prisoner that he will probably die many years before he pays off the debt. The fellow prisoner says, "That is, of course, unless you purchased eternal life."
"The first thousand years? I won't live that long!"
"Sure you will, Jang assured him. You got immortality, didn't you?"