If I'm understanding correctly, you want to detect when the user has dragged a puzzle piece into the correct slot.
If that's the case, and correct me if I'm misunderstanding, you'll need at least two pieces of information to make it happen: the position of the puzzle piece's correct location (i.e. the position the piece should be in when the puzzle is put together), and the same puzzle piece's current location as it's being moved by the user. Once you have this information, perhaps as two CGPoints (correctPosition and currentPosition), you can get the distance between them with ccpDistance():
CGPoint currentPosition = selectedPuzzlePiece.position;
float distanceFromCorrectPos = ccpDistance(correctPosition, currentPosition);
In the above example, correctPosition could be a CGPoint stored before the pieces are mixed up, and selectedPuzzlePiece could be the CCSprite the user is currently touching. You could then use the distanceFromCorrectPos value to determine when the user has moved the piece close enough to snap it into place:
float snapIntoPlaceThreshold = 10.0f;
if(distanceFromCorrectPos <= snapIntoPlaceThreshold) {
selectedPuzzlePiece.position = correctPosition;
}