Is there ever a good time to send a character to the afterlife? For me the answer is, yes. I have always dealt with this on a case by case basis. I try to provide the player with ways to die in an epic manner. Most of the time I can foresee a character’s demise. As a GM you should be able to deal with a character death in a way the player can feel validated by their end.
The epic death can affect more than just the player. It can affect the whole party. Usually the death occurs near the end or at the end of a long campaign. It is almost as if the character feels that last minute heroics are needed to fulfill the quest. Maybe taking the last charge while wounded to save a friend. Sometimes it can be a sacrifice to let the rest of the party escape. These scenarios can go on forever. It may be in the player’s best interest to read about different cultures and their histories to find correlation to their characters. Regardless of the way they die the GM should play the scene to its fullest.
There are times when the player is just fumbling around or acting a fool. I mean this beyond what would be normal role playing for the character. Some game systems have traits that are role played. If the player is being careless with their character, let them have it. Depending on how deadly the system is, this can lead to an untimely death. I have on occasion seen this happen. In my experience it is usually with a player that has lost interest in the character. Dealing with that is a whole topic unto itself. As a GM try to deal with it and pay attention to address the issues the player has before he rushes into the orc camp, naked and with a stick.
The other death I have seen is the natural one. When the party has felt that it is time to finish up with the characters, I have let them come up with endings. I give each player a few minutes to explain what happens to their characters. Most will talk about retiring or opening up a tavern. A few have described the end of a full life. I always feel that when a player describes the death of their character, they have closure.
Should the GM kill characters? In some circumstances yes. The deadly and evil GM may think that is fun to put players in impossible situations that lead to death. If everyone is on board, that can be fine. I think that the characters death should have a great meaning to the player first. If it affects others that just adds to the story.