TLDR: Here is a flowchart to explain it to you.

The main goal of your healer is to keep the group from wiping. As long as the tank can hold aggro and the healer can keep the tank alive, the team will not wipe. As long as the tank and the healer is still standing after an encounter, the rest of the group can be resurrected. That is why DPS is a lower healing priority and will only get heals when it is valuable and can be done safely.
Healer’s mana is the health bar of the whole group. When the healer runs out of mana, everyone dies. That’s why we don’t waste mana unless it’s for the benefit of the group.
A good rule is for everyone who is not tanking, manage your threat and bring bandages.
Class guides on how to make your healer’s job a lot easier
Shaman
If you are in the dungeon to do DPS, you still have healing powers. You can heal yourself if needed.
Healing totem may help conserving mana for the healer. Drop them close to the action when appropriate.
Rogue
Manage your threat levels. You have leather armor and require lots of mana to keep alive, and this is mana that would better go to keeping the tank alive.
Druid
You have healing capabilities. If you take damage you can go out of feral form and heal yourself. It will conserve mana for your healer.
If you start off-tanking you will have the same healing priority as main tank. It is good to inform your healer that you are off-tanking in a pull, unless it’s a spur of the moment thing.
Mage
Manage your threat!
You have cloth armor and most expensive to heal if you draw aggro. Do not start AOE if you don’t know you can finish off the mobs. No healer can keep up with a group of mobs descending on a cloth wearer.
Keep the healer in your sight at all times. If they get attacked, a polymorph might save the group. A well placed frost nova can give the healer enough respite to save the tank.
Priest
Manage your threat. Fade if you accidentally draw aggro. Heal yourself as needed.
Even if you’re in the dungeon to do DPS, dropping Renews as an off-heal, will help greatly for everyone’s benefit. Helping out with dispelling both magic effects and diseases with greatly help the group.
Warrior
If you’re tanking, use a shield. If you’re DPS, manage your aggro. Off-tanking will grant you healing privileges, but please make sure your healer is aware that you intend to off-tank.
Paladin
You have great capabilities to stay alive. Make sure the healer knows when you’re off-tanking so you get dedicated heals.
You are welcome to drop in some extra heals if you notice the healer is struggling.
Warlock
The healer’s mana is not your way to top the damage meters. If you’re life tapping, you will have to manage your own health bar. Do not expect any heals to make up for life taps.
Soulstone on the healer, will help the group to come back quickly after a wipe.
Hunter
Manage your threat and Feign Death. Healing a leather wearing hunter is much expensive on the mana pool of the healer.
If you see the healer being attacked, a great help is to send your pet to the mob that is attacking the healer.
Never assume that your pet will get heals from the healer.