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.
Sail numbers only need a three-character country code if the boat will be raced internationally. Mainsails and storm trysails need numbers on both sides.
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.
There is a charge 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.