Here is an interesting article by John MacArthur about when to leave a church.
When Should People Leave Their Church?
Leaving a church is not something that should be done lightly. Too many people abandon churches for petty reasons. Disagreements over simple matters of preference are never a good reason to withdraw from a sound, Bible-believing church. Christians are commanded to respect, honor, and obey those whom God has placed in positions of leadership in the church (Heb. 13:7, 17). However, there are times when it becomes necessary to leave a church for the sake of one's own conscience, or out of a duty to obey God rather than men. Such circumstances would include:
If heresy on some fundamental truth is being taught from the pulpit (Gal. 1:7-9).
If the leaders of the church tolerate seriously errant doctrine from any who are given teaching authority in the fellowship (Rom. 16:17).
If the church is characterized by a wanton disregard for Scripture, such as a refusal to discipline members who are sinning blatantly (1 Cor. 5:1-7).
If unholy living is tolerated in the church (1 Cor. 5:9-11).
If the church is seriously out of step with the biblical pattern for the church (2 Thess. 3:6, 14).
If the church is marked by gross hypocrisy, giving lip service to biblical Christianity but refusing to acknowledge its true power (2 Tim. 3:5).
This is not to suggest that these are the only circumstances under which people are permitted to leave a church. There is certainly nothing wrong with moving one's membership just because another church offers better teaching or more opportunities for growth and service. But those who transfer their membership for such reasons ought to take extreme care not to sow discord or division in the church they are leaving. And such moves ought to be made sparingly. Membership in a church is a commitment that ought to be taken seriously.