Which NPC in WoW will try to kill you and which will not?

The first thing to look for is if you could attack the NPC (move your mouse cursor over them, if it's a sword you can attack them, if it's a hand you can do nothing to/with that npc, if it's another cursor you can interact with them in a friendly way). If you can't attack the NPC, the NPC won't attack you.

If you can attack the NPC, the NPC can attack you (back). But not all NPCs are aggressive and will you attack on sight. Some will (with variable distance at which they attack, this is called "aggro range"), some won't. Regretfully there is no way to check if the NPC will attack you on sight or only fight back when attacked.

For most situations you learn by experience what to expect from an NPC. And with higher level your chance to escape if attacked also improves so it's no longer deadly when you aggro an NPC.