Gnosticm isn't a single belief or religion. So it is hard to pin down how it differs from Christianity. Indeed there are even forms of Gnostic Christianity.
It was a general movement in the Mediterranean Basin in the first few centuries CE. The basic point of a gnostic belief, was that there was some special form of knowledge that could provide something for the learner. Gnostic itself is derived from the Greek word for learned or knowledge. So a gnostic was simply someone who claimed to have some sort of knowledge. Exactly what this knowledge was or what it was supposed to do for the learner varied wildly from group to group. For the most part Gnostics believed that their special knowledge would somehow grant them access to special treatment in the afterlife. And usually this knowledge was shared by one deity or another. Most of the Mystery Cults of the early CE era could and sometimes were called gnostic.
And Christianity included gnostic subgroups within it. These were almost religions within a religion where certain individuals would be initiated into he "true meaning" of Christianity. But even within Christianity there were dozens of different sects of Gnostics, all claiming secret knowledge.
Let me give you one example; this should demonstrate the kinds of things that some Gnostics may have believed... but it shouldn't be taken as representative of all gnostic Christian belief, let alone gnostic belief in general, because there is no general gnostic belief.
In this mythology God was complete and whole within himself. But for some reason he divided himself into some of his attributes and gave them a separate existence. He still existed as himself whole and unchanged. But he also now existed as these separate beings as well. In some forms of the story he creates only a few, a dozen, or even up to 300 of these beings. One of these beings was Sophia (Wisdom). And for whatever reason (it differs from version to version) Sophia created an additional being known as the Demiurge.
Now the Demiurge didn't share in Sophia's wisdom. She couldn't impart any of herself. And she also couldn't duplicate any of God's other attributes. But she could emulate them. So the Demiurge got similar characteristics to God, but they were imperfect. Being an imperfect being the Demiurge couldn't perceive God or his attributes (even his own mother). And so he thought he was alone in the universe. To ease his loneliness he created the physical world. Unknown to him the only source of "material" to work with was God. So the Demiurge was taking parts of God and separating them from the whole. With this divine essence he created Earth and Adam and Eve. The Demiurge you see was Yahweh, the god of the Old Testament.
The original God saw this and was sad because parts of himself were now separate consciousnesses; something he approved of. But they were separated from him and ultimately from enlightenment and perfection; which he disapproved of. So he incarnated himself into the material world, as Jesus. When he died and returned to himself he forged a path that would allow all of humanity to follow and reunite with him. He also imparted the secret knowledge of how to follow this path he created to some disciples who then provide this secret knowledge to the rest of humanity.
In some versions ultimately everyone will follow the path back, but by learning and accepting sooner we reduce our suffering. In these versions there is some sort of reincarnation. And the ultimate fate is that the Demiurge will be saved and restored to God as well. In other forms the Demiurge is damned for his actions as are any who don't follow the secret path back to God and his attributes. They ultimately would be destroyed or simply permanently separated from God.
Depending on the details of the belief it could affect behavior. Some Christian gnostic communities encouraged celibacy, believing that by having kids you were stealing some of the original God's essence and adding to the suffering of the world. Others encouraged large families believing that the essence was a set amount stolen in the beginning and by having children in a gnostic family exposed souls to the proper knowledge faster.
Regardless of the details of the specific beliefs of the gnostic groups, other early Christians viewed them as heretics of the most dangerous kind. They denied the saving power of Christ's atonement, placing salvation in secret teachings. So they were firmly opposed.
/u/QuickSpore did a great job of putting in the overview of the religious movement; I'll do a short spiel on ideology and terminology before bedtime folks feel free to call me out.
"Gnosticism," speaking rather generally, is a reference to either (a) the ideas of a group of syncretic religions focused on gnōsis in the second through fourth centuries CE or (b) the tendency of religious intellectuals to seek personal knowledge of, and acquaintance with, the divine; this second definition doesn't take a period of time into account and is used more generally (see Pagels, The Gnostic Gospels for that interpretation). In most cases, the endgame of "gnosticism" is personal knowledge of the divine--the real God (Father, True God, etc.), not the false creator God (Demiurge, Ialdabaoth, Sakla, Samael). N.B. here: Layton (who's back-referenced in a lot of the literature) and Pagels disagree here somewhat, as Layton notes that the justification for speaking of a psychological or philosophical pattern called “gnosticism” has never actually been made up to standards; he suggests beginning with the “first coherent sect that called itself ‘gnostic,’ then [tracing] its historical and ideological evolution into a later form." (The Gnostic Scriptures)
“Gnostics” versus “gnosticism” is a distinction that a scholar should make both semantically and historically; “gnosticism” as a catchall, Meyer argues in The Nag Hammadi Scriptures, shouldn’t actually be used at all with respect to the religious movement of the second century AD. Unlike the other terms used in the context of studying the movement (gnōstikos, gnōstikoi, and gnōsis), “gnosticism” isn’t directly Anglicized from the Greek, and it also wasn’t used self-referentially by these sects; it wasn’t popularized until the seventeenth century, long after the movement had effectively died out. We then replace it with references to separate schools of “gnosticism,” which were briefly touched on by /u/Quickspore—“Sethians,” “Thomas Christianity,” “Valentinian Chrisianity,” “Hermetics.” Pagels argues that these terms are applied to the gnostic writings out of a need for expedient categories; she’s not entirely wrong, but drawing lines make it much easier for scholars to slog through the references and subversion contained in the texts themselves.
Back to that argument Meyer makes: It hinges on the transferral of the term gnōsis from Greek to English, and the use of its derivatives by the “knowers” themselves. In koine Greek, gnōsis is a noun that just means “recognition,” “knowledge,” or “acquaintance;” it’s derived from the Greek verb gignōskein (“to come to know,” “recognize,” or “perceive). That’s interesting in and of itself; there are two types of knowledge, basically speaking, in the Greek. Verbs like eidenai describe what’s termed by Layton “propositional knowledge,” the knowledge that something is the case (“I know that Athens is in Greece”); the other type of knowledge is personal acquaintance, which is what is meant by gignōskein (“I know Athens well”).
The use of the terms gnōstikos and gnōstikoi (singular/plural, respectively) as descriptors of a group of people, the “gnostics,” is weird, too; it’s the expansion of a technical noun, which expresses a quality of facilitating personal acquaintance, to encompass a certain subset of people; the closest English equivalent, rather than “knowers,” is something like “acquainters” or “recognizers.” It’s as weird in Greek as it is in English. Here’s Layton on the philology of this bit:
As a mere word, the Greek term gnōstikos goes back as far as the time of Plato. It was a rare technical word with philosophical overtones; it means something like “leading to knowledge” or “capable of attaining knowledge.” In normal usage the terms was never applied to human beings; that is to say, normally a person would not be called “gnostic.” Rather, the word “gnostic” regularly referred to disciplines of study, human faculties, capacities, and the like. Thus, for example, the Platonist philosopher Plutarch could write, “Human souls have a faculty that is gnōstikos (leads to knowledge) of visible things.”
So when a social group in the early second century A.D. began to call itself gnōstikoi, or “gnostics,” this usage would have sounded like odd sectarian jargon—as though a modern club began to call itself the Perceptives or the Epistemologicals.
Jonas and Pétrement give more sectarian definitions of gnōsis; Petrement compares it to the average Christian’s “faith,” and notes that it wasn’t until the big heresiology binge of the second century and onward that the distinction between pistis (“faith”) and gnōsis was made. Jonas, furthermore, explains gnōsis as “the means for the attainment of salvation, or even as the form of salvation itself;” possession of this knowledge (or how to get it) is a fairly standard trope of gnostic lit.
Gnostic Christians, loosely, are a group of syncretic sects (syncretism, as defined by Vallée: “the amalgamation of disparate religious doctrines and practices”) who subverted the Old Testament; beyond this, /u/Quickspore was right, it’s not a single belief or religion. There are different qualifying criteria for different scholars, and I’m happy to elaborate on that in a followup if you’re interested. Syncretism, as well, is not specifically “gnostic;” Manichaeism (which is like Dualism 2.0) and mystery religions were also syncretic, and do exhibit overlap with what’s considered “gnostic” doctrine. The “gnostic” writings themselves are a hell-mashup of OT commentary, New Testament lore (or its basic form), astrology, arithmancy, Oriental mysticism, Hellenistic philosophy, and religious dualism.
As to where it came from and how it fits into early Christianity as a whole, that’s another disputed point; for each eminent gnostic scholar, there’s a different chart of origins and ideological succession of gnostic schools. The best model I’ve found for its context within Christianity, though, is to think of orthodoxy as a via negativa; that is to say, “we don’t know exactly what we believe, besides Jesus and Paul, but this isn’t it (points to Sethians) and this isn’t it (points to Valentinus) and this isn’t it either (points to Thomas)."
One thing I do have to nitpick in the top comment, though, is this statement:
They denied the saving power of Christ's atonement, placing salvation in secret teachings. So they [Christians] were firmly opposed.
That's only partially true; while it's the view commonly taken by heresiologists (church fathers who wrote treatises against heresy in defense of proto-orthodoxy/orthodoxy), it's not actually a belief held across the board as far as the sects themselves. Thomas Christianity and Valentinian Christianity in particular hold Christ as a salvific figure, and Valentinus himself was a devout Christian (he was once in the running to be bishop of Rome). The beef with the gnostics came about not only because of the restriction of the salvific message (and its arbitrary nature) to a chosen group of "knowers," but also from the rejection of the church's set hierarchy and power structure, and said church's transmission of knowledge through a succession of legit bishops.
Edit: "To" --> "the" typo.
hi! it may be worth x-posting this one to /r/AskReligion