"The world forgetting, by the world forgot."
In context:
How happy is the blameless vestal's lot!
The world forgetting, by the world forgot.
The second line, in more conventional syntax:
Forgetting the world, and by the world forgotten.
This is a sentence fragment (common in poetry), and the "subject" is only in the previous line. So here, the meaning is that a "blameless vestal" (chaste woman) would be happy, forgetting the world, and forgotten by the world (unlike Eloisa).
The use of "forgot" instead of "forgotten" is common in old poems. ("I know of no reason / Why the Gunpowder Treason / Should ever be forgot.")
How happy is the blameless vestal's lot!
The world forgetting, by the world forgot.
Eternal sunshine of the spotless mind!
Each pray'r accepted, and each wish resign'd;
In the context of the poem, the meaning of the lines is straightforward, syntactically: Eloisa is comparing the 'happy lot' of a hypothetical blameless virgin ("vestal") in the convent with her own tragic fate. The vestal with her spotless mind experiences "eternal sunshine" (sunshine is metaphorically used for brightness, happiness, etc) unlike Eloisa's darkness and torment because of her persisting love for Abelard. All of the vestal's prayers are accepted, presumably because they (and she) are pure and simple, and the vestal easily resigns (gives up) her wishes and submits to the will of God — unlike Eloisa, whose prayer/wish for Abelard can neither be fulfilled nor can she succeed in giving it up.
This is a line of a poem, and so is not necessarily a sentence. Poetry often takes many liberties in structure (poets have a license). The first three lines of the stanza are:
How happy is the blameless vestal's lot!
The world forgetting, by the world forgot.
Eternal sunshine of the spotless mind!
I take the subject of the second line to be implied from the first: the vestal, and the line is saying the vestal is forgetting the world, and is forgotten by the world.
Wikipedia gives a fuller quote and background information on the plot, which makes it easier to understand the poetic phrasing:
How happy is the blameless vestal's lot!
The world forgetting, by the world forgot.
Eternal sunshine of the spotless mind!
Each pray'r accepted, and each wish resign'd
In the context (of Eloise going into a monastery), the line in question means:
Eloise'The blameless vestal [virgin]' forgets about the world, and the world forgets aboutEloiseher.
Or:
The blameless vestal is able to forget about the world (outside the monastery), and the world forgets about her.
You can find the complete poem here.
You have to take the previous line
How happy is the blameless vestal's lot!
So your line means She is to forget the world and she is to be forgotten by the world or if you prefer something simpler, then perhaps She is forgetting the world and she is forgotten by the world. The passive participle forgotten becomes forgot through poetic licence.