My Samsumg s2 locked. How can I enble the USB debugging? My phone is locked (I forgot the PIN number). I want to back up my files. So I need to enable the USB debugging.
If it's the PIN of the SIM card, remove the SIM from the phone and you're in.

If it's the PIN you set in Android, you can try to install a custom recovery via ODIN. You can then boot into recovery and download your data from there, since most (if not all) recoveries provide an ADB interface.

In the prevoius version of this answer I expressed my concern that most phones erase their data prior to flashing and I didn't know if Samsungs do. But as Adi Inbar pointed it out, Samsungs don't erase their data when flashed through ODIN so this is a solution. You are lucky to have a Samsung phone which can be flashed in an out-of-spec way, because otherwise:

You can not retrieve your data if you can not unlock your phone. This is a security feature of Android which keeps your data safe if it gets stolen.

You can take the SD card out and copy the files from that, but unless you remember the phone's PIN, your data on the phone's internal memory is not accessible.