The Gospel according to John teaches that after Jesus was resurrected He appeared to Mary Magdalene and instructed her not to “hold” Him because He had not yet ascended to His Father. Yet after that and before the ascension, He told Thomas to place his hand in His side. What happened between the events to allow Thomas to touch Him when Mary could not?
Mary had “lost” her Lord once and wasn’t going to risk losing Him again, so she was holding on to him for dear life. But He didn’t tell her not to hold Him. What He actually said to her was, “Don’t hold on to Me for I have not yet returned to the Father.” (John 20:17) He couldn’t have been talking about His ascension because they all saw Him that evening. And He was with them for a total of 40 more days.
Hebrews 9:11-12 gives us the answer. “But when Christ came as high priest of the good things that are now already here, he went through the greater and more perfect tabernacle that is not made with human hands, that is to say, is not a part of this creation. He did not enter by means of the blood of goats and calves; but he entered the Most Holy Place once for all by his own blood, thus obtaining eternal redemption.”
Having fulfilled His role as our perfect sacrifice, He was preparing to act as our High Priest, sprinkling His blood on the altar in Heaven as His final act of atonement for our sins. So it wasn’t a matter of not letting Mary hold Him. He was asking her to let go of Him so He could perform this final task. By evening time He was back and appeared to His followers in the upper room (John 20:19-20).