Who decides if an autopsy is needed?

Medical examiner or. Depending on the situation, an autopsy can be ordered by the medical examiner or coroner if the death is un-natural - accident, suicide, homicide. A patient's doctor may want one to clarify the cause of a natural death. But even if the patient's doctor wants one, it has to be authorized by the legal next of kin. A family may want one for piece of mind or to investigate possible malpractice.
The law, or you. Any suspected homicide gets autopsied. The law has jurisdiction over all possible accidents and suicides as well; i autopsy all auto drivers to rule out "dead at the wheel" as the cause of the accident. I believe you have a sacred right to have a loved one autopsied for free to learn the truth -- today's crazy economics makes this hard. I'm sorry if you've had a recent loss. Good luck.