By my reckoning (some are questionable), there have been 20.5 voluntary, 11.5 forced, 8.5 deaths and 1 unknown (Ace). If you consider death a forced exit, then it's around a half forced and a half voluntary (most often for love).
- Susan wants to leave (she falls in love), but decides that she can't (because she has to look after her grandfather). The Doctor forces her out because he knows that it's best.
- Barbara and Ian were kidnapped by the Doctor. They leave voluntarily (the Doctor opposes it) when they find a way to get home.
- Vicki falls in love and leaves voluntarily.
- Steven leaves voluntarily in order to lead a peace effort.
- Katarina dies (sacrifices herself to save the Doctor).
- Sara Kingdom (dubiously a companion) dies by accident.
- Dodo leaves voluntarily (with no real reason given).
5.5 voluntary exits, 0.5 forced, and 2 deaths.
- Polly and Ben join the 1st Doctor by accident. They voluntarily leave when they have a chance to resume their normal lives.
- Jamie and Zoe are forced to leave by the Time Lords. (Jamie potentially came back in "Season 6b", and his second departure is unknown; given that the Doctor still ends up exiled to Earth, Jamie likely was forced to leave again).
- Victoria leaves voluntarily to live a normal life (much the same as Martha)
3 voluntary exits, and 2 forced.
- Brigadier Lethbridge-Stewart played a similar role to a companion, but the Doctor left him, so doesn't really count for this question (and he died well after this). The same is true for Sergeant Benton and Mike Yates.
- Liz Shaw never travelled in the TARDIS, but was essentially a companion. She voluntarily left UNIT (with no real reason given).
- Jo leaves voluntarily (she falls in love).
2 voluntary exits.
3 voluntary exits, and 2 forced.
3 voluntary exits, and 2 deaths.
1 forced exit.
- Mel leaves voluntarily for another type of travel.
- We don't know about Ace, because the series was cancelled before we found out. Apparently the intent was for her to leave (presumably voluntarily) to train to become a Time Lord.
1 voluntary exit, 1 unknown.
- Grace declines to travel with the Doctor (a voluntary exit before anything even starts!), although it's questionable whether she can be considered a companion.
0.5 voluntary exits.
The War Doctor does not have any on-screen companions (I do not consider the Moment a companion), although he does in other media.
- Adam Mitchell was forced out by the Doctor after not even one episode.
- Jack Harkness is left behind, although after Utopia he voluntarily returns to Torchwood.
2 forced exits.
- Rose is forced to leave (although she does actually stay with a Doctor).
- Mickey Smith leaves voluntarily (multiple times!).
- Martha leaves voluntarily to live a (somewhat) normal life.
- Donna is forced to leave because she cannot survive knowledge of the Doctor.
The 10th Doctor also had several 'one-off' companions - most lists include them as companions although they never travelled with the Doctor and only appear in a single episode. None of them can be considered to have "left" the Doctor, although two do die (Astrid Peth and Adelaide Brooke), one of whom probably would have travelled with the Doctor.
2 voluntary exits, 2 forced.
- Amy and Rory leave unwillingly after a Weeping Angel sends Rory to 1930s New York, and Amy willingly chooses to be sent back along with him. The Doctor reading their tombstone creates a fixed point in time, so the Doctor is unable to rescue them.
- River is similar to a companion, although we don't really see much of her travelling with the Doctor. Her final appearance in The Husbands of River Song is after her official "death" in "Forest of the Dead".
In my opinion Craig Owens isn't a companion, although he plays a similar role in an episode.
- Like the Brigadier, Danny Pink never travels with the Doctor, but does play a similar role as a companion. He is killed when he is hit by an automobile, turned into a Cyberman, and eventually sacrifices himself to destroy the rest of the Cybermen, and sacrifices his return journey from the Nethersphere to send back a boy he killed during his time as a soldier.
- Clara Oswald is killed, then brought back between 2 heartbeats using Time Lord technology. She tricks the Doctor in forgetting about her, then leaves voluntarily for an adventure together with Ashildr in a stolen TARDIS. She will eventually have to return to her final moment so she can die.
- Bill leaves to explore the universe with Heather, voluntarily (her prior cyber-conversion doesn't seem to count as a death given the circumstances), although her only other choice was returning to Earth, not continuing to travel with the Doctor (much like Romana).
- Nardole is instructed by the Doctor to lead a group of people to safety, which he does. I consider this a forced exit.
Ashildr is similar in companionship to Craig Owens: the Doctor is involved in multiple episodes with her, but she never actually travels with the Doctor in his TARDIS. In my opinion, she is not a companion.
1.5 deaths, 0.5 voluntary exits, 2 forced exits.
We do not yet know how Graham, Yasmin, and Ryan will leave the Doctor.
The above only includes companions who appeared on TV episodes (and the 8th Doctor movie); those that appear only in spin-off media (audio dramas, novels, etc) are not included. The TARDIS Index File has more information about the companions, including the fate of these additional companions.