What happens to the soul when someone gets an artificial heart?
Transplanting the heart doesn't transplant the soul. The soul, according to Bhagavad-gita, is seated in the region of the heart. But when the heart moves, the soul doesn't.
When the surgeons switch the natural heart for a plastic one, the soul merely switches seats, like a man rising from his chair to accept a new one. So the soul of Dr. Barney Clark lived on in his artificial heart.
But whether made of flesh and blood or plastic and metal, the heart is just an inanimate pump for the bodily machine. And eventually the whole machine will break down, forcing the soul to transmigrate to a new body.
Unfortunately, the highly skilled mechanics who built Dr. Clark's heart didn't know anything of the science of the soul. If they had, they would have spent more time trying to give Dr. Clark a way to achieve eternal life in his original, spiritual body rather than a few extra weeks or months in his desperately ill material one.