Stockpile raises the user's Def and SpDef by one stage, while raising the Stockpile counter. This counter can go up to 3 and raises the damage dealt/healed by the moves Spit Up and Swallow. Using either of these moves resets the Stockpile counter.
The move does not currently work properly. Using Spit Up or Swallow doesn't reset the Def and SpDef increases, and using Stockpile when the counter is already at its maximum will still raise the user's Def and SpDef.