Towards the end of the movie, the Other Mother's hand searches for the key in the real world, but Coraline leads the hand into the well. The hand almost got the Key, but Wybie saves Coraline by crushing the hand under a large rock. They wrapped both the key and the hand in a blanket, tied it shut with the string from the Key, and threw it into the well.
Towards the end of the book, Coraline has a tea party with some of her dolls, putting a tablecloth over the (opened) well and setting the key on the tablecloth. The Other Mother's hand grabbed the key, but in doing so fell down the well. The well was sealed and the hand trapped.