What is the total number of sets that LEGO has released?
It might be impossible to give the precise number simply because some older sets are yet to be found and new ones are being added with a slight delay. 

These three are the major websites having the most details about sets:


Bricklink catalog has 15824 sets in its catalog.
Brickset has 16378 sets.
Rebrickable has 15432 sets.


As you can see numbers are similar, but yet differ slightly. This is due the fact that each site has its set of rules. For example, it may treat some sets as accessories, thus including/excluding them.  

All numbers are up-to-date as of the time of this answer.