There are actually a lot of variables that go into figuring out how to properly package, ship, and store electronic devices. The Joint Electron Device Engineering Council (JEDEC) maintains a standard for specifying these procedures:
The standard provides the following equation to decide how much desiccant to use:
When the desiccant capacity at 10% RH and 25°C is known the following equation should be
U = (0.304 * M * WVTR * A)/D
U = Amount of desiccant in UNITS*
M = Shelf life desired in months
WVTR = Water vapor transmission rate in grams/m2 (grams/100 in2) in 24 hrs
A = Total exposed surface area of the MBB in square meters (square inches)
D = The amount of water in grams, that a UNIT of desiccant will absorb at 10% RH and
*Note from the standard:
For comparison between various desiccant types, military specifications adopted the ‘‘UNIT’’ as the basic unit of measure of quantity for desiccant material. A UNIT of desiccant is defined as the amount that will absorb a minimum of 2.85 g of water vapor at 20% RH and 25°C
You should review this standard carefully when making packaging decisions, because there are a lot of variables involved in choosing correct packaging. In addition to the variables in the above equation, things like package size, anticipated humidity exposure, reflow bake times, and more need to be considered.
And yes, the package must be sealed for any of this to be applicable.
Although this industry standard covers most cases, you should also be aware of standards that govern your device's particular application. For example, the U.S. Department of Defense has standards MIL-PRF-81705 and MIL-D-3464 that describe their requirements. These two particular documents are, as far as I know, adhered to by J-STD-003B.1, but there may be others in your particular industry that J-STD-003B.1 is not compliant with.