The subtle reference to grafting occurs in line 12 of Shakespeare's Sonnet 18:
When in eternal lines to time thou growest:
The specific words relevant to grafting are "in ... lines to time thou growest."
Grafting is an ancient horticultural process of combining branches from one plant with the body of another plant. For instance, walnut varieties may be grafted together by embedding the branch of one into the trunk of another so that one tree produces more than one variety of walnut,
The idea the sonneteer is expressing is that his beloved will become part of immortal Time through being grafted in and thus live forever as Time itself "lives" forever. This metaphor is also dependent upon a personification of time, such that time may receive a graft and such that it may "live."