There are a lot of different situations that call for leaving lane. You want to catch their jungler at your red/blue. You want to invade their red/blue. You want to take a dragon. You need to go back to base and heal. You're losing lane so hard that staying is worthless. Laning phase is over and it's worth it to give up your tower so that you can get objectives as a team. How do you recognize these situations, and what's the best way to respond to them?
GOING BACK TO BASE.
This is the most straightforward reason to leave lane. You want to go to base when the extra power you have from spending your gold on items and refreshing your resources is worth losing the amount of experience/cs that you will lose by leaving. There are two factors here: the amount of money you can spend/resources you can gain and the amount of creeps/objectives you will lose. Try to leave when you are able to buy something significant and won't miss out on too many creeps or any objectives. Generally, it's more important that the ADC have a particular amount of gold (e.g. enough for a BF sword, enough for two DBlades, enough for a vamp scepter and boots, etc.), but if you're 50 gold from a Chalice or a Sightstone, and both of you are high resources, then you can stay a bit longer. Try to leave when your creeps are pushed to their tower or when the lane is reset in the middle and their botlane is gone; generally you will miss out on at most a single wave of experience and gold if you leave at a time like this, and frequently you won't even miss out on that.
Bad times to leave are when you have a wave on your tower or the wave is about to push towards your tower; generally, if this is the case then it's safe for you to stay and get the experience and gold that would otherwise go to waste. Sometimes you have to leave even at bad times (as far as creep positioning goes), though. This happens when you don't have enough resources to stay safely---you can be out of wards or not have enough hp and mana to fight the number of enemies near bot. If their jungler and midlane are closing in for a gank and your midlane and jungler are both going top, consider just basing and potentially giving up the tower to avoid both dying 2v4 and giving up the tower.
Occasionally, you will want to leave lane separately from your ADC. In general this is not ideal because neither one of you will be able to pick up very much exp or cs while alone in lane, so you may as well have gone back at the same time. However, this is not always the case. If you're winning lane really hard and your ADC doesn't want to go back any time soon, but you need to leave so that you can either pick up an item or more wards, then you can go back while he stays and continues to CS. Just after killing one of them is a very good time for you to base, again unless your ADC is planning on leaving soon too. If you're so low that their jungler can one-shot you and you don't know where their jungler is, then you should go back to base. If you're completely out of resources, consider going back, especially if their support isn't one that can zone very effectively. Once you're level 6, gaining experience isn't nearly as important as it is before 6, and so it's ok for you to lose an entire wave or two worth of exp to go back to base while your carry is farming safely under tower.
Dragon is definitely worth more than the botlane farm. If you need to be at dragon in order for the dragon to be safe, then you go to dragon. If the enemy mid, jungle, and ADC are all dead and your jungler has 80% HP and your ADC has enough damage that he and the jungler can quickly and safely take dragon, then take the botlane CS and exp while your jungler and ADC take dragon. Or go with your jungler to take dragon while your ADC takes the botlane farm. If the dragon isn't safe even with you and your ADC there, then maybe don't attempt it if there are two waves at your tower, but dragon will help your entire team win, and it's worth it to sacrifice your own resources for it.
FIGHTING IN THE JUNGLE.
There are several reasons that you might want to fight in the jungle during laning. As always, you should make a quick cost/benefit analysis when deciding whether to go as a team. Do you really need that buff? Do they? How risky is the fight---what cooldowns do they have? What cooldowns do we have? What does our ward placement look like? How easily can they get away from us if we chase? How easily can we get away from them if the fight is starting to go poorly? What's the creep positioning in midlane/botlane? How much experience/farm will we lose out on relative to the enemy if everyone rotates?
If your team decides to go, usually it's worth it for you to rotate and help your team, even if your carry stays in lane to get CS. This is especially true after level 6; pre-6, if you fall too far behind in exp, it can be very bad for your lane, but once you have level 6 it doesn't matter nearly as much. When you're going to save a teammate, try to communicate about which way he's going to run: it's frequently not efficient for you to take the quickest route to where he is now; you should be taking the quickest route to where he will be when you meet up. When you're trying to catch someone out, try to go to a place where you'll be able to cut him off, and if you pass a choke point you should drop a ward if possible, especially if you already have your Sightstone.
HELPING ANOTHER LANE.
Any support can roam and help another lane. If your carry is doing so well that he can 1v2 for a minute while you're gone, and toplane is losing really hard, go help toplane. Most supports are able to be useful by ganking, especially after hitting level 6, and those that are not can still help another laner by providing sustain---don't underestimate the strength of midlane getting free mana and a heal followed by toplane getting a free heal from a level 7 Soraka. And if your toplane is behind, saving him 75 gold and the time it takes to go back to base by giving him a ward can also be huge.
Be careful about losing too much experience if you leave a lot before level 6; generally, you need to be very certain that you will secure a large advantage for your laner if you leave that early. This is even more important for supports like Soraka or Sona whose ultimates can be game-changing than for supports like Taric or Blitzcrank, whose ults are certainly powerful but not quite as influential.
ABANDONING A LOST LANE.
If you're going to lane and immediately dying to the enemy botlane, stop going to lane. Do something else. It's not worth it to keep feeding them kills. You can go lanegank toplane or even just sit mid and put pressure on the enemy's mid turret. If the enemy botlane stays bot, your team temporarily has an advantage; and if they leave bot then either your carry or both of you can go down and catch up on much-needed experience and levels. Hopefully your jungler is able to make plays happen in toplane, and if this is the case then you and your carry can take his jungle for safe experience and gold.
ENDING LANING PHASE.
Once in a while you'll have a game where you and your carry are winning so hard that you can push the first tower, continue laning at the second tower, push the second tower, continue laning at the third tower, and eventually push that too, winning the game without ever needing to leave botlane. However, in the vast majority of games you need to leave your lane at some point and group with the rest of the team. A good rule of thumb is leave lane when one of the turrets gets pushed, but don't be afraid to leave before that if your team's teamfight is significantly superior to your laning.
Even following this rule of thumb, you frequently need to decide when you want to push the enemy's first turret down. There are several factors to consider here: How much will their carry benefit from freezing lane? Will it be safe for you to lane past their destroyed first tower? How easily can they defend their middle turret? Their top turret? What objectives are available---if we push bot turret can we then take dragon? Or even baron? How strong is our ability to teamfight? To towerdive? How is laning going? How easily can we get ganked right now? How much does our team want to be able to keep ganking our lane?
Reasons to leave the tower up would be the following answers: Their carry will benefit a lot from freezing lane (e.g. Vayne). It's not safe for us to lane past their destroyed first tower because their Lee Sin jungle is pretty fed and their midlane has a global ult. They can easily defend their middle turret because Anivia has such good wave clear. They can also defend their top turret because Jayce has really good wave clear. Dragon is down, and we don't have the damage to be a credible baron threat yet. Our team isn't great at teamfighting; we're more about small skirmishes, and we're not tanky enough to towerdive. Laning is going well---We're zoning their Kog'Maw very effectively, top is even and Irelia scales better than Lee Sin, and both midlanes are just farming. We're not too scared of ganks from jungle/mid because we're well warded, and we have a global ult so counterganks are very doable. Evelynn and Lee Sin both want to keep ganking botlane, and they're being very effective, so we'd like their botlane to be forced to be out as far as their outer turret.
Reasons to push tower would be the following answers (for the most part they're just the opposite of the above): Their carry won't benefit much from freezing because his lategame isn't that great (e.g. Graves). We have no problems laning past their destroyed first tower because their jungler and midlane are both fairly shut down, so we can just ward up and not worry too much. They can't defend their middle turret that well because Evelynn has very little wave-clear and doesn't have any kills yet, so we easily push turret down. They can't defend top turret because Singed is destroying Jax right now. Dragon is up, so we can push tower then take dragon then rotate mid. Baron is up, and we actually have enough damage to take it if their carry stays bot, so we can force him to push lane out and lose the freeze even if we don't necessarily actually take Baron. Our teamfight is really good---we have Zyra mid, Amumu jungle, and Sona support, so we'd really like to group and have 5v5 fights. We can easily dive 5v4 and get tower plus a couple kills if their carry stays bot when we group mid. Laning isn't going that well for us---Varus is out-trading our Miss Fortune, and Nunu can't sustain any of Sona's poke, so we'd like to stop laning ASAP. Their Nocturne and Katarina are ganking us over and over, and we can't stay this far out because it's not safe anymore.
The tl;dr of all of this is, "Can I be more useful to my team by leaving than I can to my carry by staying?" If the answer is yes, then go; if no, then stay.
Next time I'll talk about teamfighting as a support; that update should take less time than this one did because I'm already about halfway done writing it.