The Greek word hairesis that is translated 'heresy' or its plural (Strong's Concordance #G139) is in Acts 24:14, 1Corinthians 11:19, Galatians 5:20 and 2Peter 2:1. It means "disunion, someone who causes division." The New Testament warns against those who teach lies and split true Christians apart.
1. But there were also false prophets among the people, as indeed there will be false teachers among you, who will stealthily introduce destructive heresies (2Peter 2:1)
6. I am astonished that you are so quickly being turned away from Him Who called you into the grace of Christ, to a different gospel, 7. Which in reality is not another gospel; but there are some who are troubling you and are desiring to pervert the gospel of Christ (with heresy, Galatians 1:6 - 7).
Note that the New Testament does not unilaterally condemn a person who believes, even on a variety of subjects, something different (heresy) than what is stated in a fellowship's statement of beliefs. It also does not use the label 'heretic' on those of differing opinions.
What the Bible DOES condemn, however, is the use of such beliefs as a means to divide a local fellowship or church. Paul, in his letter to the Romans, states that people who gather to worship God can have different understandings regarding a range of topics.
1. Receive the one who is weak in the faith, but not for divisive arguments. 13. Therefore, we should no longer judge one another, but judge this instead: Do not put an occasion of stumbling or a cause of offense before your brother (Romans 14:1, 13)
Today, when church leaders label someone as a heretic, they usually mean the person in question has rejected one or more tenets deemed foundational to the group. The person is considered to believe heresy and will be (usually) asked to keep such beliefs to themselves and / or told not to attend the group any longer. Such rejection may even take the form of being forcibly thrown out and officially disfellowshipped from the church they attended.