Many but not all sailboats have numbers displayed on their sail, what do those numbers mean?
I am looking for a general answer, not one specific to the random example image below.
One word: Racing
The numbers themselves usually don't mean anything. Usually, the number is essentially "how many sails of this model have been produced before this one".
So, the first boat will have sail number 1, the 1000th will have sail 1000.
Not all boats will come with numbered sails. However, racing sailboats will always have them.
The numbers are then used to identify boats in races.
After some time, the sail number and the boat become the boat's identity, so when replacing sails the buyers usually specify the number so it can match their old worn out sails.
Sail numbering has virtually nothing to do with watercraft registration, that is dependent on the hulls, and is usually identified with stickers affixed to the hull.