Fight or escape?
Always try to escape.
- That one kill you might get fighting a 1v6 is not going to matter by the time the rest of your team gets back up.
- Make it as hard as possible for people to pursue you and get that last bit of ultimate charge out of your health. If you're lucky, they might overextend chasing you and run into your team.
- Give your healers a decent amount of ultimate charge from you, which otherwise they'd miss because everyone close is at full health.
- The risk of dying anyway is minimal. A just-showed-up-with-full-health team should be okay holding the line without you until you get back.
It depends on the hero that your playing, how well you know that hero, the team composition to a certain extent, the type of mode: escort, assault, control, the type of game: quick play, competitive, brawls.
If defending (escort) a payload then you need to keep the other team away from it or contest, so even if just two of them chase you then that means there are two who are further away form the payload and it might not move as quickly and if any of your team mates show up then for a few moments it's potentially two less for them to deal with.
If attacking (assault) a payload you want delay the enemy as much as possible, but depending on where the payload is, you need to decide what to do, if the payload is near a checkpoint, and your death will delay it a little then you need to decide whether it's better to delay them to give your team more time to get there or to stay alive to distract them and heal up so that you can take some of them out or weaken them.
On an control map, if it's just you and there are more enemies than you can kill with current health and dexterity, then there's little point in sacrificing your life if the other team holds the objective, but if your team holds the objective try to delay them somehow, staying alive on the objective should be your priority, rather then doing damage, so trying to move around erratically so you can last longer.
Switching roles and strategies aside, if your teams strategy is or seems to be one of those that depends on a role that only you currently fill then you might consider an early death so that you can get back with your team as soon as possible.
Most heroes have abilities that allow them to stay alive or to get away, become intimate with those abilities and use them when you can.