The only object that may be dropped on the court and not stop play is a player’s racket. The racket may be picked up and the rally may continue. If the dropping of a racket is because of contact with the opponent, a let may be allowed (whether it is the striker or opponent).
Whenever any other object is dropped on the court, play should stop immediately. If the object dropped because of contact with the opponent, a let is allowed. If not, the player dropping the object loses the rally. If any object drops on court from an outside source (officials, spectators, next court), then a let should be played. A ball from the court next door is the most common of these of course.
If the dropped object is not noticed until the end of the rally, the result of the rally stands. At any time, racket or any other object dropping, if a winning return was in the process of being played, or was prevented from being played, the winning return (or stroke) should be the result.