There is no set time. You can still file for divorce the day after you get married
But you can get a divorce only if you can prove one of the following.
1. Hateful leaving
2. Sexual dysfunction
It is not practical to file for divorce as soon as you get married, as it is very difficult to prove such a thing within a very short time of getting married.
It is best to consult with your legal advisor.