On cruising boats, the sail number is usually the hull number; but if the boat is going to be raced more than local club races, the boat will need to get a number from national sailing federations like US Sailing, Sail Canada, the Royal Yachting Association, etc.
There is a charge per character for numbers and country codes. If you do not plan to sail outside your own country, you can save the cost of the country code, which gets placed on both sides of mains and genoas.
Numbers only have to be placed on one side of a spinnaker, and they are not required on genoas with an LP (Luff Perpendicular) of 120% or less.
Sail numbers only need a three-letter country code if the boat will be raced internationally. Mainsails and storm trysails need numbers on both sides.