Change your preferences here.
If the user faints before the user makes a different move, the move that KOed the user will lose all of its PP. If the damage occurs in the end of the turn by hail, sandstorm, Leech Seed, status, Doom Desire, or Future Sight, then Grudge won't work. If a Pokemon uses Grudge, switches next turn, and faints to Pursuit as it switches, then Pursuit will lose all of its PP. This move cannot be blocked by Substitute. This move cannot be blocked by Protect or Detect.
Grudge is unheard of competitively as sacrificing a Pokemon merely to drain the opponent's PP is simply not worth it.
Destiny Bond also involves the user fainting to an opponent's attack, but it will force a KO.