The basic elements in the Gnostic myth of redemption, the concrete features of which can very in details, are as follows: A heavenly being is sent down from the world of light to the earth, which has fallen under the sway of the demonic powers, in order to liberate the sparks of light, which have their origin in the world of light, but owing to a fall in primeval times, have been compelled to inhabit human bodies. This emissary takes a human form, and carries out the works entrusted to him by the Father; as a result he is not cut off from the Father. He reveals himself in his utterances ('I am the shepherd', etc.) and so brings about the separation of the seeing from the blind to whom he appears as a stranger. His own harken to him, and he awakes in them the memory of their home of light, teaches them to recognise their own true nature, and teaches them also the way of return to their home, to which he, as a redeemed Redeemer, rises again.
Bultmann, Article on the Fourth Gospel in Die Religion in Geschichte und Gegenwart
Of course, Bultmann thought the gnostic redeemer myth helped to explain John's Christology. But, as Neill points out, the evidence for a pre-Christian gnostic redeemer myth is non-existent...
In pre-Christian Graeco-Roman religion there was no redeemer or saviour of a Gnostic type...The most obvious explanation of the origin of the Gnostic redeemer is that he was modelled after the Christian conception of Jesus.
R M Grant, Gnosticism (1961), 18
April de Conick holds that there was no discrete gnostic 'religion' and that gnosticism developed first within Judaism in an attempt to reconcile it with Middle Platonism. Check out her views here. It's all interesting stuff.