How many USMLE attempts I can do?

As of 2016, the total number of attempts you can take on a USMLE step or a step component is 6 attempts. However, you can't take the same component more than 3 times within 12 months period. You also have to wait for 6 months to take the 4th attempt after the failed 3rd one. You migh consider doing observership to get a better idea about how it works if you are repeatedly failing the CS component.