No, he didn’t.
This story was invented by a certain Lady Hope, who was an evangelical Christian and shameless liar. Her account was denied by Darwin’s own daughter, Henrietta, a devout Christian, who was with her father throughout his final illness.
For more on this subject, please see the Lady Hope Story (Talk Origins website).
Unfortunately, Lady Hope’s lie simply refuses to die. I review a very bad book perpetuating the myth here.