If you are proceeding on fault grounds, i.e. cruelty, desertion, adultery, you can file immediately. If the matter is contested it can take six months or a year or more to go through the process of litigating the fault grounds and the equitable distribution and support issues.
Child custody and visitation are another matter that have to be decided. These may be separate hearings and can lengthen the process. If you are proceeding on no-fault grounds based upon separation you must be separated the required period of time. If there are children or you do not have a separation agreement, you must wait one year. If there are no children and you have an agreement, you only have to be separated six months. When you file on no-fault grounds you can usually get the divorce in several months, sometimes less. It really depends on the efficiency of your local court.