The more skilled you become, the quicker you wear out strings. Replace them whenever they become worn, broken, or dirty.
If you're a beginning yo-yo enthusiast, it's wise to replace your string every three months or, or at least when you notice the string is getting frayed or your yo-yo is getting more difficult to control. A bad string can greatly affect your performance, so always keep an extra or two handy. The professionals, on the other hand, replace their strings at least once a day. The more you use your yo-yo, and the more vigorously you use your yo-yo, the more often you'll need the string replaced.