I've been through this dozens of times both domestically and internationally. The bottom line is this: the airline has the ultimate say in what can or can not be brought on board their commercial aircraft, despite what TSA may allow. For example, according to TSA policy, batteries mounted on or in a device are allowed in checked bags, however, most airlines do not allow any Li-ion batteries in the cargo hold. This is further complicated by the current electronics ban on carrying any electronic items larger than a cell phone on board a flight from several countries into the US. (several countries in Europe are now also adopting this restriction) So therein lies the conundrum.... on certain flights, no electronics with batteries larger than a cell phone are allowed in the cabin of the plane, but Li-ion batteries are not allowed in checked bags by the airline. Ultimately, it's the airlines call since it's their plane. They want the Li-ion batteries in the cabin in the event there is an issue since flight attendants have been trained how to deal with a Li-ion battery in the event of a fire. With computers and tablets the airlines are allowing those items to be checked, but you risk the possibility of losing your Li-ion batteries for larger devices in checked bags if discovered by the airline. They just won't show up at your destination. So what to do? I carry on ALL Li-ion batteries as described above, and discharge them all to safe 'travel' levels (around 15-20% charge) The post above is correct that any batteries under 100mw hours are allowed on flights.... however, once again the airline has the ultimate say on how many batteries are allowed. Most do have restrictions on total Li-ion amount despite individual allowances. I tend to just emphasize that I know what the regulations are (no more than 100mw per battery) show them if asked what the Li-ion content of the batteries are, and then add that I've discharged them to 'safe' travel levels and show them on the LED readout. (they never seem to understand why this is advisable, but do seem impressed that I do it)
So far I've not had a problem. I do contact each airline ahead of my flight to get their policy if I've not flown that airline before. Get a copy of those rules if you can, and keep it on your phone. You would be surprised how often airline employees are not up to date on their own policies. You will find that almost always, their regulations are quite different than the TSA. Just to make things even more complicated, new electronic restrictions have just been implemented just this week by the TSA, and will generate much more scrutiny of electronics and especially Li-ion batteries brought aboard ALL flights both within and without the continental US. Know the TSA rules, and be prepared to show them (keep them in a document on your phone) if questioned in security.
Sadly, these are the times we live in. Given recent revelations about terroristic activities, it's understandable. Don't argue with TSA or the airline, just be as prepared as you can on both sets of regulations and be prepared to show them by whichever entity might be questioning your carryon. Domestically it will be TSA, and they aren't even aware of the individual airlines policies. Most of the time they don't even pay attention to which airline you are flying. Internationally, you may get much higher levels of multiple screenings, and most of these secondary screenings are often done at the gate by the airline itself. So be ready with their particular policies, because getting stuck just before boarding is not a good place to be!
Finally, if you do a lot of flying, get enrolled in the Trusted Traveler program. (Global Entry and Pre-Check) A lot of the time that helps at least show it's not your first rodeo, and sometimes it can even reduce the level of screenings if they realize you've been 'pre-screened'. This doesn't happen as often as it should, and I hope that changes soon because it's a waste of everyone's time to have someone go through every item in your carryon when you are already a Trusted Traveler.
Be safe and be informed!