You get a favor for every 4 cases you solve successfully. Successfully completed favors count toward this number.
For example, you solve three cases and then get a favor. After completing the favor successfully, you will need to complete 3 more cases before getting another favor. However, if you complete the favor unsuccessfully, you will have to solve 4 more cases before earning another favor.