Usually a couple of months. You record does not necessarily have to spotless. However, if you have a conviction (or convictions) for a crime of moral turpitude, a controlled substance offsense, etc., this could affect your eligibility for immigraition benefits.
This answer is offered for informational purposes only. It is not offered as, and does not constitute, legal advice. You should rely only on the advice given to you during a personal consultation, telephonic or in-person, by an attorney experienced in immigration law. In the event that you have follow up questions, please post them directly on this site. This does not create an attorney-client relationship and the attorney does not read unsolicited emails. Thank You.