What the last two lines of this sonnet mean is that Shakespeare is bragging about the importance of his work and of this poem in particular.
In the rest of the poem, he has talked about (among other things) how brief and transient a summer's day is. Then he has contrasted that with how his love will be immortal. He has said that she will never die because he has written this poem about her (that is what the line just before the couplet is saying).
In the couplet, he completes the thought by saying that as long as people exist, this poem will exist and she will live in the poem.
Shakespeare's sonnet 18 is by far the best known (for those outside of literature circles) and one of the most quoted. It is written in the traditional Shakespearean (or English) style of sonnet. It contains three quatrains and followed by a rhyming couplet. The couplet section is the portion that this questions is about.
Let's walk through a brief summary of the three quatrains before we address the couplet.
Quatrain 1: The poem begins by addressing the beloved, whom the entire poem relates. The beloved is being compared to a summer's day. Shakespeare says, "Rough winds do shake the darling buds of May,/And summer's lease hath all too short a date:" In this, he is saying that love and summer both are fleeting and can easily be shaken by "rough winds" that come their way.
Quatrain 2: Quite literally, this section says that sometimes summer (and love) are too hot and can decrease the beauty of the beloved. In the line, "And every fair from fair sometime declines," discuss the changing course of the season. Quite literally, the change from summer to fall (the change of love in youth to age). He says that nature will not halt these changes.
Quatrain 3: "But thy eternal summer shall not fade," the beauty of the beloved shall never fade, like the real summer does. In the eye of the speaker, the beloved shall always be beautiful and lovely. And, the beloved shall never find death or lines of age.
Couplet: "So long as men can breathe or eyes can see,
So long lives this and this gives life to thee"
As long as there are readers, breathing and seeing, the beloved shall always live. The sonnet shall always live, and it will keep the beloved (and their love) alive.
I hope this summary of a great work helps :)
The theme of Shakespeare's sonnet is that mankind is indeed mortal: all human beings will die. The only way to immortalize a human being is by praising him in excellent verse which the future generations will always read. Shakespeare compares his lover to "eternal summer" and he has immortalized his lover in his sonnet 18:
But thy eternal summer shall not fade
Nor lose possession of that fair thou owest;
Nor shall Death brag thou wander'st in his shade,
When in eternal lines to time thou growest:
So long as men can breathe or eyes can see,
So long lives this and this gives life to thee.
Every year the season of summer will come only once to be followed by the season of autumn, but Shakespeare tells his lover and his readers that unlike the season of summer which is a temporary annual phenomenon, his verse will immortalize her and make her "eternal." Shakespeare forcefully concludes his sonnet by asserting that her beauty, and his love for her will remain deeply etched forever in the minds and memories of his readers.