As @yannis and @Valorum have said in the comments, the play's original title Three Blind Mice had to be changed because there was an earlier play with the same title. Yannis shared this information from the official Agatha Christie website:
The story was adapted from a radio play, Three Blind Mice, written for the Royal family in 1947. The stage play had to be renamed on the insistence of another producer, Emile Littler, who had used the name on stage before the Second World War, and it was Agatha Christie’s son-in-law, Anthony Hicks who suggested the new title. In fact, it refers to Shakespeare’s Hamlet, in which Hamlet cryptically calls the play depicting the murder of the king, ‘The Mousetrap’.
In order to understand why The Mousetrap is an appropriate title for Christie's play, let's look at the play-within-a-play in Hamlet. Hamlet's father's ghost has told him that Claudio is a murderer, but Hamlet worries that perhaps the ghost is an evil spirit deliberately misleading him. So to verify the ghost's story, Hamlet comes up with the plan of staging The Murder of Gonzago before Claudio.
In that play, Gonzago is murdered in exactly the same way that the ghost claims he himself was: his wife's lover poured poison in his ear. Hamlet wagers that if the ghost's story is true, Claudio will not be able to help reacting in a way that betrays his guilty conscience:
I’ll have these players
Play something like the murder of my father
Before mine uncle. I’ll observe his looks.
I’ll tent him to the quick. If he do blench,
I know my course. The spirit that I have seen
May be the devil, and the devil hath power
T' assume a pleasing shape. Yea, and perhaps
Out of my weakness and my melancholy,
As he is very potent with such spirits,
Abuses me to damn me. I’ll have grounds
More relative than this. The play’s the thing
Wherein I’ll catch the conscience of the king.
So the play-within-a-play is designed as a trap for Claudio. Enticed by the prospect of a delightful evening's entertainment (the way a mouse is enticed by cheese), Claudio will find himself caught. When Claudio asks Hamlet what this play is called, Hamlet does not supply its actual name, The Murder of Gonzago:
What do you call the play?
The Mousetrap. Marry, how? Tropically.
Marry, how? Tropically means:
Why the heck is it called that? It is a trope, i.e., a figure of speech.
(Marry, like heck, is a minced oath; it refers to the Virgin Mary.)
So in Hamlet, The Murder of Gonzago is a metaphorical mousetrap to catch a murderer. Christie's play is also about catching a murderer, and that makes The Mousetrap a good allusive title for it. The connection with the thematic mice of the original radio play makes it particularly fitting. Another relevant point is that the name of the play was changed: Christie changed the name of Three Blind Mice to The Mousetrap, just as Hamlet did with The Murder of Gonzago.
So why was the original play called Three Blind Mice to begin with? The murderer in the play sets out to kill three people; since they can't see what's coming, and don't know why they are going to be killed, and two of them end up trapped in a snowed-in house, they are blind mice. (Partial spoiler follows.)
It turns out also that the murderer has picked his victims for revenge. They were responsible for a terrible ordeal he underwent as a child: he and his two siblings were placed in foster care with a farmer whose wife beat them mercilessly. The three abused children were "blind mice", helpless and trapped, at the mercy of the farmer's wife.
The nursery rhyme is thematically apt to the story, and is used as a motif throughout the play.
More generally, Christie was fond of using nursery rhymes as titles and themes for her work. Here are some examples:
No doubt there are others. "Three blind mice" fits with this general partiality toward nursery rhymes, and when that title was hors de combat, "The Mousetrap" was a good substitute.