Gnosticism (from the word "gnosis" meaning "knowledge"), in relation to Christianity, is a diverse belief system that existed alongside the so-called "orthodox" Christian tradition and often rivaled it for power and influence. It's understanding of Jesus and is teaching was known almost exclusively through the view of its critics in the first generation or so after Jesus' death until the mid-20th century discovery of a trove of ancient gnostic texts.
The Nag Hammadi library - named after the town near where a farmer discovered a sealed clay jar containing 13 leather bound codices - was discovered in 1945 in Egypt and finally made available to scholars for translation in the 1970's. In the codices are 52 tractates in various genres - gospels, revelations, treatises, etc. - written in Coptic that are 4th century translations of texts most likely written in Greek during the 1st or 2nd century in Israel/Palestine or Syria.
The Nag Hammadi library provides the most exhaustive access to the actual beliefs of the gnostics of the Christian period. Through them, we get textual insight into the history of the early Jesus movement, and an enhanced sense of what Jesus did and taught based on this expanded list of recorded teachings and about him and claiming to be from him. Most importantly, the library - and the existence of "christian gnosticism" in general - pushes us to consider the the oral tradition in those early years after Jesus died and the plethora of written sources about the sayings of Jesus that began to appear soon after his death but before the gospels of the New Testament were written or fully completed.
For example, Paul - living in the 50's CE - never met Jesus except in visions, and he mentions in his letters teachings and traditions of Jesus that he studied. These would have been in existence prior to the writing or complete formation of the 4 New Testament gospels. So, it seems clear from Paul, from other scholarly research, and from the Nag Hammadi discovery, that there were many sayings, remembrances, recording and teachings about Jesus - who he was, what he did, what he taught, the importance of all these - that circulated for several decades after his death and long before an "official" or "orthodox" message was established by recognized "authorities" of what became "the church".
Gnosticism as a belief system is hard to characterize because it is very diverse and many of its traditions are cloaked in esoteric secrecy. In general, it includes a dense cosmology of supernatural beings, archons, and levels of reality. A common view, although not consistent across all groups, is that the earthly realm is a fallen material realm dominated by corruption, illusion and sin. From time to time, in every era, the Divine (sometimes understood as a godhead, male/female God, Father, Mother, etc.) sends emissaries to our realm to show us the way, to alert us to our inner nature, or our true "divine" or spiritual nature. These beings may appear as other human beings, but really they are beyond human, which becomes apparent at some point or another.
Jesus, in such a scheme, is one of these emissaries. Gnostic interpretations - textual and otherwise - of his life focus on his teachings almost exclusively, as opposed to the New Testament gospels which focus on his miracles, his death and his resurrection. Unlike in the traditional orthodox view, Jesus' teachings - not his death or shed blood - are central to salvation.
Nag Hammadi texts offer a window of sorts in gnostic Christian practice, which included some of sacraments that became central in "orthodox" Christianity - rites like baptism, anointing with oil, eucharist, the initiation of priests and rites of the dying. However, their meanings and interpretations are distinctly gnostic in theology and perspective. Additionally, words like "redemption" and "salvation" have distinct meanings that differ sharply from what became the orthodox teaching.
For example, baptism for both gnostics and the orthodox, is a resurrection of the "new man" or the spiritual person. For the latter, however, this is the precursor to a later physical resurrection that will happen either at death or at the last judgment. For the former, the baptism is the resurrection - period. There is no other one that is coming - the new man, the spiritual person is fully present forever after the baptism.
The Eucharist, or communion meal, for the orthodox Christian is a sacrament or ceremony referring to Jesus' blood sacrifice for the redemption of sins. For the gnostic, who doesn't give any meaning to Jesus' blood, the eucharist is an act of union, a taking in of the spiritual nature of Christ via eating or ingestion.
Gnosticism was eventually defeated as a worldview within "orthodox" Christianity and was deemed heretical.
It did not disappear, however; it continued to appear throughout the
history of Christianity in various groups and sects. It has enjoyed a
revival of sorts since the late 20th century with the rise of the "new
age" religion and the success of The DaVinci Code by Dan Brown.