The rule: unique, and in order
Every invoice needs a number that no other invoice of yours has, and the numbers should run in order with no gaps you cannot explain. That is how you, your client and a tax inspector match a payment to an invoice, and spot one that is missing.
UK: every invoice must include a unique identification number. A VAT invoice must show a sequential number based on one or more series which uniquely identifies the document. US: there is no federal rule on invoice numbers, but a clean sequence makes your records easy to follow.
Sources: gov.uk: invoices, what they must include, HMRC: VAT Notice 700, section 16.3