All perfect praise be to Allaah, the Lord of the worlds. I testify that there is none worthy of worship except Allaah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
Indeed, engaging in such an act is one of the gravest sins and most hideous crimes in the Sight of Allaah Almighty. It is even graver than committing adultery! However, since you have been blessed with repentance, Allaah, the Exalted—out of His Mercy and Grace—will forgive your past sins and pardon you. The Prophet, sallallaahu ‘alayhi wa sallam, said: "The one who repents of a sin is like the one without sin." [Ibn Maajah]
For repentance to be sincere, the following conditions should be fulfilled (and accepted): giving up the sin, regretting committing it, and resolving never to re-commit it ever again. If these three conditions are fulfilled and the sin is not related to another person's rights, then the repentance is considered sincere and Allaah, the Exalted, will forgive the past sins of the repentant and pardon his faults, regardless of their number or gravity, even if he does not leave the place where the sin has been committed. However, it is recommended a person in such a case to leave the place where the sins were committed, severe his relations with his bad friends who helped him to commit them, and replace them with a good and righteous company. This enhances and emphasizes his repentance and takes him away from the evil environment in which the sins were committed. It also helps him maintain his steadfastness upon righteousness and eliminates the hardship and embarrassment of seeing the young children whom he sexually molested.
Muslim scholars based their opinion about the recommendation of leaving the place where the sins were committed and severing relations with bad friends who helped the sinner commit those sins on a Hadeeth that was reported in Saheeh Muslim. The Hadeeth relates the story of a man who killed 99 people and was advised to migrate to another land, where people worshipped Allaah, the Exalted, and not to go back to his land, where he committed those sins. This caused him to obtain the mercy of Allaah, the Exalted, and enter Paradise.
You should also pay attention to the fact that leaving your town should not be at the expense of neglecting other rights and obligations. For example, if you have parents, grandparents, or siblings to whom you tend and provide for, and your departure would cause them to suffer destitution, then you should not leave the town.
Allaah Knows best.