The limit
TSA’s entry: “The FAA limits you to 5.5 pounds of dry ice that is properly packaged (the package is vented) and marked. Airline approval is required.”
The FAA’s PackSafe page puts the same number as 2.5 kg (5.5 lbs) “per package and per passenger,” for dry ice used to pack perishables.
How it has to be packed
The FAA says packages “must NOT be air tight and must allow for venting and the release of carbon dioxide gas.”
In checked baggage the package also has to be marked “Dry ice” or “Carbon dioxide, solid,” along with the net quantity of dry ice or a note that it is 2.5 kg (5.5 lbs) or less.
Adding gel packs
The FAA’s tip is that blue ice and gel packs can supplement the dry ice. In a carry-on, anything with more than 100 ml (3.4 oz) of liquid or gel in one container has to be frozen solid at screening. Ice packs has TSA’s wording.
Flying home from abroad
TSA’s answer covers screening at US airports. On the way home you go through the other airport’s screening first, and its rules are the ones that count there.

TSA puts this on every entry: “The final decision rests with the TSA officer on whether an item is allowed through the checkpoint.”