What (if anything) will happen to a bike whilst it sits unused, that wouldn't happen to it whilst being used for a work commute over the same period?
Suppose I take a 3 month sabbatical and leave my bike locked up and secure, in the same place that it would normally be (outside, moderately exposed to the elements). When I come back 3 months later would I have to do/check/refurbish anything that I wouldn't have had to do from just using it daily for 3 months (and still outside the whole time)?
Is the answer different if it's "2 years", or "3 weeks" rather than 3 months?
Of course things rust in normal use. Still, rust without moving is worse, as things stick together.
Even if the chain is generously oiled (more so than normal) before storage you'll get rust and probably stiff links. Any gears made out of normal steel will also rust. (A light coating of spray oil will reduce but not stop this. I use GT85 on my outdoor bike; make sure you don't get it on the rims).
If your rims are steel (mainly old bikes) they may rust under the chrome plating.
Brake pads and rims are likely to be dirty, which will affect braking performance. I'd clean them with plain water at first; if greasy use alcohol.
Most brake cables are stainless; but, especially on old bikes, there are braking components that aren't. A good hard squeeze of both levers before you start riding would be a good idea, and try the brakes cautiously on the first ride before you get to traffic.
The tyres will need pumping up. When you do so, check for cracks in them. And test the pressure again soon afterwards, as the tubes may not hold air as well as you think. It may be a good idea to pump up the tyres to slightly higher than the stated max pressure, then leave the bike a few hours before reducing the pressure to normal and riding.
Gear shifting components may well rust. I've found rear derailleurs to suffer more than front derailleurs. Again storing dry (of water) and oiled will help.
Some locks rust badly. If your lock gets too rusty you may not be able to open it. Some bike lock manufacturers recommend oil -- if yours does, follow that recommendation. Keeping the keyhole downwards may help, but water can run into locks from other directions too.
A non-mechanical factor:
Don't assume it's as secure left in the same place for months (and certainly not years) as it is left overnight. The landowner may have a good (or bad) reason to remove bikes which appear abandoned. Or a thief might think: "no one will miss that; I'll take it". You also can't neglect the possibility of vandalism or careless damage, especially if a bike appears abandoned.
The difference in the 2-year case is that the degradation is more certain, leading to your bike being more likely to be scrapped as abandoned. If the bike isn't special enough to take with you, it's probably better to sell it and replace it when you get back. This is because, after a couple of years it will probably need more than it's worth spent on it. A few weeks doesn't seem much worse than a weekend if you oil everything and can keep the worst of the rain off (I do this several times a year under the edge of a canopy on a station platform).
In addition to the answer offered by Chris H, with which I agree, I would add the following items:
Your local climate will play a big role in how parts will degrade over time when stored outdoors. A damp and humid environment will result in more rusting, while a sunny and dry environment will be harder on plastic, rubber, and other "soft" parts.
Another thing to consider is the various lubricants throughout the bike. Sometimes they can break down or separate. For instance, heavy greases used in bearings can separate such that there is a thicker gel and a thinner liquid. Furthermore, high temperatures (either ambient or due to heating by sunlight) can cause the lighter components of greases and oils to evaporate, leaving behind a slightly waxy substance that doesn't lubricate as well. I have seen this when restoring old bikes, and though I cannot say with certainty how long it takes to happen, I would think it would be more than three months. Still, I would think it best to check (or have checked by a shop) the various lubricated components when you return.
In addition to rust&dust, the saddle can go bad. I kept my bicycle outside without riding it for about a month, the saddle became as damp as a used diaper. Probably won't happen in dry climate or with the cheapest type of saddle (e.g. those stamped out of something like a thick sheet of rubberized pressurized artificial leather).