The 80-year-old was in a stable condition in hospital in London, his agent John Grant confirmed.
Wilson had been due to reprise his role as Victor Meldrew, the grumpy pensioner in BBC comedy One Foot In The Grave.
His 12-night run, billed as I Don't Believe It! An Evening with Victor Meldrew, was due to begin on Tuesday at the Assembly Roxy.
The show's promoters, Assembly, confirmed the cancellation of the production.
In a statement, they said: "Due to ill health, Richard Wilson has taken the decision, to take some time out.
"He is sorry to have to disappoint those hoping to see him in Edinburgh.
"We hope to plan further shows for later in the year."
Mr Wilson was born in Greenock and came to acting relatively late.
He studied at the Royal Academy of Dramatic Art after completing national service in the army and working as a hospital lab technician.
He later won plaudits in the acclaimed 1987 series Tutti Frutti, which also starred Robbie Coltraine and Emma Thompson,
He first appeared as the curmudgeonly Meldrew in 1990. The BBC One show went on to run for six series, winning the Bafta for Best Comedy in 1992.
Mr Wilson won individual Baftas for his performance in 1992 and 1994.
Lead character Victor was killed off in the final episode but the actor was due to bring him back to life for the new stage show.
People with tickets can claim a refund or exchange them for another production at the same venue.
Actor Richard Wilson has pulled out of his Edinburgh Festival Fringe show after suffering a heart attack.