It's an important question to ask. We used to make a joke: How can you tell the difference between a Shakespearean comedy and a Shakespearean tragedy? In the comedy, everyone gets married at the end, and in the tragedy, everyone dies. This is, shall we say, a bit of an extreme difference. But what about your story? How do you know whether people should die or not?
Age group is, of course, an extremely important factor in your decision. Generally, the younger the story's audience, the less likely it is that anyone will die. Deaths in books for young people have to be very carefully decided upon, and very delicately handled.
Genre is also a huge factor. Murder mysteries begin with dead people, naturally. Thrillers often have a huge body count. Romances tend to veer away from death, for the most part. In science fiction and fantasy, there isn't a necessary expectation one way or the other. So I thought I'd take a look at some options.
1. No one dies
This one always makes me think of children's books, or children's animated shows. There's something weird about it, because no matter how dramatic the attack (and those are pushed to the heights of drama), there's never any gruesome injury or death, even when those might be the most natural result. Odd disappearances often substitute for death. The reason I bring this up, though, is because a lack of death can be handled badly or well. "No one can die" is a tricky arbitrary rule to enforce, and if you try to find easy ways of doing it, like having people coincidentally or luckily just not be injured or killed, it's going to look really weird. On the other hand, if you dig deep into how to handle it, it can also be very interesting. There's another way in which death is a too-easy way out - you can ditch a character and not have to do much except have people mourn and react. Sometimes it would be a lot tougher to figure out what might happen if the character didn't die. A non-death solution requires some ingenuity, especially when the character in question is the Big Baddie. It's never a good idea to avoid plausible and necessary injury or death out of a sense of squeamishness. However, having to deal with the real consequences of an attack that was supposed to be fatal and wasn't can be really interesting.
2. People you don't care about die
I'd also refer to this as "Only extras die." Maybe in the past, people took less umbrage at the idea of only extras dying, but at this point I think audiences and readers are pretty critical. If your story includes fighting and death, don't put a force field around your main characters. It's hard to kill off a point of view character, but it can be done. If you really feel you can't do in a point of view character, do consider important secondary characters. In the end, what you're trying to avoid is a situation where tons of extras die, but nobody in the main group takes a scratch. That would likely be seen as an authorial conceit (or, put less nicely, a cop-out).
3. The people you care about die.
This one is both tricky and interesting. We often care about the bad guy, enough at least to want him to get his comeuppance. So having the bad guy die is often a good thing - but depending on how violent and chaotic the story is, having him/her be the only one to die can be a problem. Please be aware that I'm not advocating killing a lot of people off. Let me say here that I was surprised and pleased when in The Princess Bride, Prince Humperdinck didn't actually get killed. But let's say you want to have deaths in the story which may or may not include the bad guy. In recent years, it's become more common and acceptable to have characters you care about die in stories. The first time I encountered this was in the film Serenity, and I'm pretty sure you are all aware of George R. R. Martin's tendency to make you love characters and then kill them off. The hazard of killing off characters people love is that readers need people to invest in who can carry them through the entire story. Kill the character and you may kill the reader's interest. Now, Game of Thrones has been enormously successful in spite of this, but I know at least one person who put down the books saying, "Every time I start to care about someone, they die." Kudos to George R. R. Martin for keeping so many people enthralled - but don't assume you can pull off the same thing without some careful planning. Make sure you leave someone behind to carry on the drive and momentum of the story.
I know some authors who get gleeful on Facebook when they are about to kill someone off (not always the bad guy). I remember being thrilled when a character I hated finally got to die. It can be difficult, though, especially if the death is wrenching. Think through whether the death is necessary. It can be necessary for logistical or plausibility reasons, or for emotional amplitude reasons. You don't want to be holding back out of fondness, or squeamishness. On the other hand, you don't want to be needlessly brutal. Once I read a book where the main character was constantly getting injured - so constantly that after a while it became almost comical. I was pretty sure that any normal person would have been dead or hiding out somewhere licking wounds. In any case, you'll want to look at the emotional dynamics of the story, and make whatever happens fit in to match your intent.
The last thing I'd like to mention here is the issue of minorities and death. This has come to my attention in the form of Facebook posts from some respected friends critiquing modern media and literature. Be careful who you kill off and try not to fall into discriminatory patterns. For example, black men who achieve romantic relationships are highly likely to be killed in movies, as are minority supporting characters who sacrifice themselves for the success of the white lead. There is also a tendency for women to be killed off, often in order to provide motivation for a male character (sometimes called "manpain"). Whenever I see examples of this, or see it discussed, I can't help but shudder. When I was writing For Love, For Power, I set up a love triangle between Tagaret, Reyn, and Della, with Tagaret in the middle. I knew that I could not in good conscience resolve the triangle by having Reyn die - because killing off a gay character to make it possible for another character to have a heterosexual relationship would have been despicable of me (!!), not to mention an authorial cop-out. It's far more interesting and valuable to tackle the issues that come up as people work out their differences, even if it can be more difficult.
Take questions of life and death seriously.
It's something to think about.