Every LEGO set has a unique number. Sometimes, just by looking at the set number you can derive more information about it.
LEGO sets from the 70’s and 80’s had three digit numbers. Newer sets from the 90’s had four digit numbers.
As LEGO sets became more complex and targeted at adults, they gave these sets a five digit number starting with 10XXX. For example 10210 is the Imperial Flagship.
For exclusive LEGO sets not available for sale to the public that are given out during their special factory tours or to employees, the sets are seven digit long. They begin with 40XXXXX. An example is 4000001 LEGO Moulding Machines.
Besides the boxed sets, LEGO also has polybags for small mini builds. Some of these polybags have five digits starting with 3XXXX or 4XXXX. Examples are the Monster Fighters Ghost 30201 or the recent Mini VW T1 Camper Van 40079.