Can I trust that Shakespeare's sonnets will always be published using the same numbering system? Will Sonnet 30 always be published as Sonnet 30; sonnet 29 always as 29? Was the current order and numbering system published or in manuscript form in Shakespeare's lifetime, or by people who knew him after his death? Or was this numbering system set in place one or two hundred years later? How set in stone is it? Can this exact numbering system be trusted to be followed for the next 40 years at least?
Since the numbering that we have become familiar with stems from the first edition, printed in 1609 by Thomas Thorpe, this is also the numbering used in most modern editions. However, it has been noted that not all of the sonnets in the 1609 edition were printed in their natural order. For example, Edward Bliss Reed noted in his 1923 Yale edition,
The two chief literary problems are: when were these sonnets written and in what order should they be printed? (…)
The order of the sonnets is a fascinating study. It has sometimes been assumed that sonnets Nos. 1–125 are all written to or about a lovely youth. It is certain that No. 126, the lyric in couplets, marks a division in the series and that most of the sonnets placed after it concern themselves directly or indirectly with the dark woman; but it does not follow as a corollary that all the sonnets before No. 126 refer to a man. (…)
It is easy to see that many of the sonnets are printed in their proper sequence (Nos. 1–17, 40–42, 63–65, 78–86, for example), but on the other hand some sonnets are clearly out of their natural order (cf. Nos. 70, 77, 81). It is not at all certain that all of the sonnets before No. 126 must refer to the youth Shakespeare praised, though Thorpe may have thought so or wished the reader to think so. (…)
However, as can be seen from the table of contents of the Yale edition, Reed preserved the original order. For example, sonnet 18 is Shall I compare thee to a summer’s day?, sonnet 55 is Not marble nor the gilded monuments and sonnet 116 is Let me not to the marriage of true minds, just like on Poetry Foundation and many other sites. William J. Rolfe's 1883 edition also uses the familiar numbering and order.
The two editions I own, i.e. one edited by Peter Kerrigan (Penguin) and one edited by Colin Burrow (The Complete Sonnets and Poems, Oxford University Press) also use the familiar order and numbering.
But since the sonnets were not printed in their natural order nor, presumably, in the order they were written, research has been done to determine a more sensible order or even a chronological order. For example, All the Sonnets of Shakespeare, edited by Paul Edmondson and Stanley Wells (Cambridge University Press, 2020) claims to the first edition that
assembles all of Shakespeare's sonnets in their probable order of composition.
It does not only include the 154 sonnets from Thorpe's 1609 quarto edition, but also the sonnets in Shakespeare's plays. However, the order from the 1609 edition can be reconstructed by using an index at the back of the book. This implicitly acknowledges that the numbering is an established feature of the sonnets from the 1609 quarto.
No manuscripts of Shakespeare's plays and poems have survived, with the possible exception of an excerpt from Sir Thomas More, a collaborative play that was not printed and probably never performed during the Jacobethan era. Because of this, all modern editions of Shakespeare's plays and poems are based on editions published between the early 1590s and the closure of the theatres in 1642.
Conclusion: Modern editions of Shakespeare's sonnets usually preserve the order and numbering used in the 1609 quarto edition published by Thomas Thorpe.
Update in response to the following comment by Jimbo:
Did the 1609 quarto just set the order, or did it actually assign the numbers we are familiar with to the sonnets? Since Shakespeare was alive in 1609, one assumes he may have assigned an order to the sonnets that made sense to him. But then again, sometimes arbitrary publishing decisions are made without consulting the author.
We don't know whether the numbering was provided by Shakespeare or by Thomas Thorpe. In Shakespeare's Sonnets and Poems: A Very Short Introduction (Oxford University Press, 2017), Jonathan F. S. Post points out that (emphasis mine),
Once regarded as an unscrupulous opportunist, Thorpe has since been accorded greater respect as a reliable publisher of important books (Jonson's Volpone for one, in 1605). But is is also true that he was not always squeaky clean in his dealings with literary property of the period, and we are still unsure how he managed to acquire the manuscript of Shakespeare's poems. Furthermore, we cannot know to what degree, if at all, Shakespeare was involved in the publication of the Sonnets that he authored.
If Shakespeare wasn't involved in the publication of his sonnets, that would be consistent with his non-involvement in the publication of his plays.