What were Darwin's beliefs at the time he died?
I assume that you are making reference here to the widely repeated story that Charles Darwin recanted his belief in evolution as he was dying. It is said that he stated that he wished he had never expounded the theory of natural selection and that he wished that he could have spoken to people (as he was dying) to encourage them to believe in conventional religious beliefs.
There is no real evidence to show that Darwin ever underwent such a deathbed conversion. Most particularly, we have the evidence of his daughter who was present with him throughout his final illness and who maintains that Darwin's beliefs did not change. Moreover, she testifies that the woman who made the claim about the conversion did not meet with Darwin in the last few months of his life.
Therefore, scholars believe that Darwin continued to maintain the truth of his theories. They believe that he continued to be agnostic with regard to the question of God's existence up to the time that he died.