You can give JEE Mains six times, over three consecutive years. According to NTA guidelines, a student can attempt both the session of JEE Main 2022. If you are appearing for boards in 2022, you can appear in both sessions of JEE Main in 2022, 2023, and 2024. So, if you aren’t satisfied with the result of first session, you can improve your score in the second attempt.
You can attempt JEE Main for three consecutive years. But if we consider the number of attempts you can give then it is usually 6 times. According to the new policy JEE 2021 will have 4 attempts, due to the corona pandemic.
It is suggested you do not worry about how many attempts you are going to get but focus on your preparation as that will only be beneficial.