How long you and your spouse must live separately before you can file for divorce – or if you even have to live separately at all – depends on where you live and the grounds on which you file. In some states, if you cite no-fault grounds, no separation period is necessary. You can file on most fault grounds right away in many states as well.
All states recognize some version of no-fault divorce, but the rules can vary a great deal. For example, in Maryland and North Carolina, you must be separated for one full year. In California, no separation period is required – you can simply tell the court that you have irreconcilable differences. You can cite irreconcilable differences in Illinois as well, but you must still live apart for six months before your divorce can be granted. Pennsylvania doesn't require a separation period, but your spouse must agree in writing that your marriage is over -- and your divorce isn't granted until 90 days pass from the time you file your petition. In New Jersey, you must have irreconcilable differences for six months, but you don't have to live separately during this time.
Fault grounds, such as adultery or cruelty, usually don't require that you and your spouse separate before you can file. However, they do require that you provide evidence of your allegations to the court -- and your spouse has the right to defend himself against your charges. If he does so successfully, the court might not grant your divorce.