Trial and error. Your opponent (CPU player) should be set to as close a level as you as possible, and the only way to do that is to start at a particular level, then change it up or down to make it interesting for you. Play a few matches in training club against Rafa, Djokovic, and Roger- that'll give you an idea of how hard they are to beat. If you can't win a game, then lower their level by one or two and try again.
I have my opponents and my doubles partner set to Pro-5. I find I can get through the early rounds fairly easily, but starting at about the round of 16, it gets harder to beat them. I've been beat at that round, but most of the time make it to the semi's or finals. My record is a winning one, but it's not easy to win at that level. All it takes is a few double-faults or errant shots and the set it lost. Then I have to fight even harder to win the match.
Just play with it. You'll eventually strike a balance of winning/losing that will make the game most enjoyable