The dates and sequences in which Shakepeare wrote and edited his 154 sonnets is very much in question. According to the British Library's webpage Shakespeare's Sonnets, they "were probably written, and perhaps revised, between the early 1590s and about 1605."
Shakespeare's complete sonnets
(Click to view)
Scan of first printing of Shakespeare's Sonnets, 1609, showing title page and Sonnets 135 and 136