Although the line is often cited as an example of personification, that is actually an impossibility. The reference to "death" is noting an action of the living, and since "death" is the ceasing of living action, the appropriate figure of speech is antithesis. It is the opposing contrast that makes it such a powerful statement.
Allusion and allegory can also be cited as figures of speech within this sonnet.
There are arguments that Shakespeare was a Catholic, so many people cite this line as an allusion to the biblical passage regarding "the valley of death". This is not, however, very likely since Shakespeare was a Master Freemason and because the moods of this sonnet and the biblical passage differ - the first being about love and the second about not fearing death because a 'greater' power will care for you.
If one interprets this sonnet as being about the 'beauty' inherent in real love, then it can also be cited as using allegorical reference. Www.m-w.com defines this figure of speech, in part, as "actions of truths or generalizations about human existence". The wearing away of youthful beauty does not cause real love to fade.
In this line, "Death" is being used primarily as personification. Personification is the granting of human thoughts and feelings to non-human things or ideas.
Here, death is given the ability to "brag" and to "wander" and to provide shade. Obviously, the actual state of death can do none of these things. Death, at its most factual definiton, is the absence of life.
The speaker gives death these qualities in order to demonstrate that even death, the absence of life, cannot kill his love. Personification is employed by poets and other writers to help us express deep emotions that refuse to be calmed by mere fact.