Section 501(c)(3) nonprofits are allowed to engage in some lobbying without losing their tax-exempt status. The key is you must make sure it remains at a level that is acceptable to the IRS.
Basically, for IRS purposes, your nonprofit engages in lobbying anytime it attempts to persuade members of a legislative body to propose, support, oppose, amend, or repeal legislation. "Legislation" means anything a legislative body must vote to adopt or reject--whether a law, resolution, proposal, nomination, treaty, zoning rule, or anything else. It also includes things like referendums, initiatives, and constitutional amendments that must be placed on the ballot and voted on by the general public. Lobbying, then, means trying to persuade a member of Congress, state legislator, city council member, county board of supervisors member, and even a member of a foreign legislature or parliament, to vote in a certain way. It also means trying to help to enact or oppose a law or other item that would have to be voted on to take effect.
However, there does not have to be a specific law pending in a legislative body for lobbying to occur. Lobbying includes support or opposition for proposed laws that are a long way from actually being voted on--for example, a church is engaged in lobbying if it urged members of Congress to approve a constitutional amendment allowing school prayer, even if no such amendment was pending in Congress at the time.
The vast majority of nonprofits use the IRS's "substantial part test" to determine how much they can lobby. This is the default test that will be automatically applied to your nonprofit if you don't make an IRS election to use the other test, called the expenditures test. Churches are required to use this test.
Under this test, a nonprofit will qualify for tax-exempt status as long as no "substantial part" of its overall activities relates to influencing legislation or carrying on propaganda. Unfortunately, this has never been clearly defined. The only IRS guidance on the issue is that it will look at "all the pertinent facts and circumstances in each case." Among the factors the IRS considers are the time devoted to lobbying by both your paid and volunteer workers and the amount of money your organization spends on lobbying. Other factors could be considered as well—for example, the amount of publicity your organization assigns to the activity, the continuous or intermittent nature of your attention to it, and the impact of the lobbying efforts.
Obviously, this is a highly subjective test—what might seem like substantial lobbying to one IRS auditor could appear like minor lobbying to another. In an attempt to find more clarity, experts have examined the few court decisions on this issue and tried to discern numerical guidelines. One court found that a nonprofit's lobbying was not substantial because it constituted less than five percent of the organization's total time and effort for the year. Another court found that lobbying was substantial where it exceeded 16% to 20% of a nonprofit's total expenditures. Many people use these figures as a rule of thumb—spending anything less than five per cent of the nonprofit's total budget is minor lobbying, while spending anything over the 16% to 20% range is substantial lobbying. However, it's important to keep in mind that these figures have no official sanction from the IRS or courts. Indeed, some courts have explicitly stated that, while these percentages are relevant, they do not themselves determine whether lobbying is substantial.
According to one survey, 85% of nonprofits devote less than two per cent of their budgets to lobbying—well under the five per cent rule of thumb. However, the consequences are severe if you make a mistake and flunk the substantial part test. If the IRS determines that a substantial part of your overall activities relate to lobbying, it will revoke your tax-exempt status for that year. This is a death sentence for most nonprofits because it results in all of the nonprofit's income being subject to tax. In addition, donors to the organization can not deduct their contributions, and you might have to pay a special excise tax equal to five percent of your lobbying expenditures. This tax can be imposed on your organization's managers personally if they agreed to the lobbying expenditures knowing that it would likely result in the loss of tax-exempt status. While it may be unlikely that you would find yourself in this position, it is something you want to be aware of because the consequences are so severe.
To learn more about the law regarding nonprofits and politics, see Nolo's section on Nonprofits and Political Activity.