You can file over and over, but that is a bad idea. What we’re really worried about is getting a discharge.
Short answer: you can file a chapter 13 immediately to stop creditors, whether or not you’re eligible for a discharge.
Long answer: this is a complicated one.
If you want to discharge your debts in a new chapter 7, you have to wait for 8 years from the date of filing the last Chapter 7 (that gave you a discharge). If you had a discharge in a 13, then you have to wait 6 years from the date that Chapter 13 was filed. (Unless that Chapter 13 paid either 100% of the unsecured claims or paid 70% of the unsecured claims and was proposed in good faith).
If you want to discharge your debts in a Chapter 13, then you have to wait two years from the file date from your last 13 that got a discharge. If you want a discharge in your Chapter 13 after filing a 7, then you have to wait 4 years from the file date of that Chapter 7.