The courier is useful throughout the game as a way to gather new items without needing to slow down your experience/gold gain. The courier is frequently referred to as a 'Donkey' 'Chicken' or 'Chick' because of how it was in original DotA. A flying courier is usually called a 'Crow' for the same reason.
In the laning phase, it's very common for a hero that is losing the lane and low on health to use the courier to bring his character a Healing Salve or Mana Potion. If he instead walks back to the base, he's spend probably 60 seconds doing this where he's unable to gain any experience. If you use a TP Scroll to return to your lane, now you've spent 60 seconds and 135 gold to heal, where you could have used the courier and 100 gold to bring you 400 HP worth of regen and not lost any experience. By doing this, now you might now have the advantage in lane and if your opponent doesn't make the same decision you can control the lane.
During this phase, returning to your base to heal should usually be done only when you're low on both health and mana and thus aren't much of a threat in the lane, or when you're no longer needed in your lane and don't have much mana (as a support hero/roamer/ganker, typically). Mana recovery through consumables takes longer and so it's more acceptable for a hero to back off to recover mana, but if you're at full health and not afraid of dying there's usually no reason to back off just because you're low on mana.
Later in the game, you can use the courier to pick up items for you at the secret shop, or after winning a teamfight, so that you can utilize the time when the enemy team is dead most efficiently.
The bottom line is this: if you're playing as a hero who needs to constantly be farming, in an ideal game the number of times you return to the well to heal/recover mana should be ZERO.
A couple of simple rules about couriers and courier etiquette:
- A support hero on your team should buy a courier at the very start of the game and upgrade it to a flying courier by no later than 3-4 minutes into the game. The most frequent usage of the courier is early in the game and so you drastically want the increased speed and safety of the crow.
- Do not get the courier killed! It is worth 150 or 175 gold each for the other team, and you don't get to use your courier for 3 minutes. That's a huge deal.
- In a dual lane, lanemates should put their items on the courier at the same time to minimize the number of trips needed.
- Only use the courier when you have a few items saved up or it's very important, such as for healing salves or a TP. Don't be a person who uses the courier every minute unless no one else on your team is utilizing it.
- If you have a solo mid hero whose laning power is highly dependent on getting an early bottle, you should not use the courier until he's gotten his bottle.
- If the courier is already doing something, don't touch it unless it's in danger. This will disrupt your teammate.
- If you do this by accident anyway, get the courier headed to a safe location near where you think it was going and just say 'reuse courier' in chat.