As has been correctly mentioned, there are a number of factors that come into play. The notoriety of the infraction, the gravity of it, the level of repentance...
There is another point that could be made here that elders in particular may want to be careful over. I have personally been on committees and know of more than several other cases where the person was wrongly removed or disfellowshipped. When they moved to another congregation they maintained their innocence and that they were wrongly removed/disfellowshipped. Since it was assumed that the originating letter was factual, it appeared the individuals were not humbly accepting discipline from Jehovah and remained disfellowshipped for years. It became apparent however that the brother was doing everything he should and was faithful. To make a long story short. The originating later was not truthful, it was malicious and we reinstated the brother immediately. Sometimes removal or disfellowshipping has been used as a club to keep whistleblowers quite. In one case the whole body that originated the removal/bad letter regarding the whistleblower was disfellowshipped for being involved in some very bad/immoral behaviour - as it was found out years later he was telling the truth - but it had been his word against theirs. That is not to put into question the scriptural foundation of disfellowshipping unrepentant wrongdoers, but simply to realize that as humans, this is at times an imperfect process and at other times - although relatively rarely, used for nefarious purposes. For those who do experience the type of things most wouldn't even want to hear about, remember who is the final judge and our dedication and loyalty is to Jehovah despite what well-meaning although imperfect (or at times wicked) men may do. For those (most) others, remember that whom Jehovah loves, he disciplines. Appreciate loving scriptural counsel as a gift (even if temporarily painful) that will put you on the path to everlasting life.
Several factors would need to be taken into consideration. How serious was the sin/offense? Is it well known with-in the congregation and general community? What was the attitude of the person when the person was approached either by another brother or the elders themselves? Circumstances that led up to the sin/act? There seems to be no time quota as such. In one congregation here in Tasmania one brother was re-instated after 3 months and in my own congregation, a brother had to wait for 7yrs 6 months, due to the wide spread results of his actions. Acts of genuine repentance is the key and Holy Spirit guides the panel of elders dealing with the issue. Jehovah then is the final judge.