Before we answer that question it is important to step back and understand why churches are exempt in the first place. The short answer is that the tax-exemption is meant to provide some extra separation between church and state, by keeping the government out of the church’s finances. Proponents also point to the fact that churches, like other 501(c)(3) nonprofit charitable organizations, which are exempt from federal income tax and are able to accept tax-deductible donations, often provide important and neutral social services to members of the public. In particular, as the Supeme Court has noted, churches “foster [the community’s] ‘moral or mental improvement.'” Walz v. Tax Commission of the City of New York (1970).
Under a 1954 amendment to the Internal Revenue Code (the so-called Johnson Amendment) churches and all other 501(c)(3) charities are “absolutely prohibited from directly or indirectly participating in, or intervening in, any political campaign on behalf of (or in opposition to) any candidate for elective public office” if they are to remain tax-exempt. In practice, the rule is almost never enforced and in 2017 President Trump signed an executive order titled “Promoting Free Speech and Religious Liberty,” which limits enforcement of the Johnson Amendment.
The most common way that your church could lose it tax-exempt status is through private inurement. A nonprofit’s income or assets should not be used to benefit any individual person or organization but rather the public good. While your church is allowed to pay reasonable salaries, income or assets cannot benefit or go to insiders such as officers, directors, or important employees. If this happens, a church could easily lose its status and also be subject to penalty excise taxes.
Many churches also engage in other forms of transactions that generate income and are not substantially related to the purposes constituting the basis for the church’s exemption. For example, a church may also operate a bookstore, or a coffee shop. If a church has $1,000 or more in gross income from Unrelated Business Income (UBI), they must file an IRS Form 990-T. In calculating this they are allowed to deduct for all reasonable and necessary expenses directly associated with the UBI. In order to prevent unfair competition between exempt and taxable organizations, if unrelated business income comprises a "substantial" portion of an exempt organization's income, loss of tax-exempt status may result.
If you generate funds from a business activity, but it is not regular, you may have to pay taxes on that income, but it won't jeopardize your tax-exempt status. Sometimes churches do everything right but forget to file the right paperwork and can lose their tax-exemot status, at least temporarily.
Finally, one of the easiest ways to lose your tax-exempt status is to simply not do what you said you were going to do. When your tax exempt status was granted, your statement of purpose was filed and included a promise that you would engage in one of the following worthwhile works: “Charitable, religious, educational, scientific, literary, testing for public safety, foster amateur sports competition, prevents cruelty to children or animals.” If your purpose changes, you must notify the IRS. If you do not, you put your status in jeopardy.
In general, if a church engages in illegal activity, or violates public policy, they could also lose their status.
If you are concerned about a particular activity and whether it falls into a grey area, make sure to consult with an attorney as soon as possible.