Seven is a good number of demons to have driven out, since it signifies completion, and coincidentally or not matches the number of capital vices. Some of the Fathers understood the reference to Mary Magdalene to mean that Jesus healed her of all vices, which would be a pretty good way to prepare her to be the Apostle to the Apostles.
But it's often easier to understand the significance of Biblical numbers than to imagine them literally. Did somebody count the number of devils Jesus cast out of Mary? Did they leave in a group after saying, "My name is Septimus, for we are seven"? Or was seven just the number settled on by later tradition, as being probably about right for someone as messed up as Mary was back then?
Whatever the case may be, we can see several things in just that brief Gospel phrase: People really can be badly messed up. Even badly messed up people can be fully healed by Jesus. Jesus will and does fully heal badly messed up people. And He goes on loving them. And they Him.