The oils that whales provided were absolutely necessary as a source of industrial lubrication, and illumination, that it became the primary profit of the industrial period of whaling conducted by Western nations in the 17th Century to the early 20th. There is an old phrase that roughly proclaimed that "American whale oil lit the world", and while patriotic and probably massively exaggerated (I do not have the information on how much whale oil was actually used to fuel things that otherwise would not have been on hand), it rings true in that the core of industrial whaling has been the cultivation and use of natural oils for economic purposes.
In that sense, they were vital, though I don't play the game of what-ifs, so I cannot speak for how the world might have looked if mass whaling was not a 'thing'. It is telling, then, that whaling has never taken a major role in the industrial 'running' of a nation since alternative sources of fuels/oils/lubrication were formed and adopted in the late 19th Century. Despite it's periods of resurgence in the 20th century (and case studies of importance, like whale meat in post-WWII Japan, whale oils and fats being imported to war torn Europe, etc.), whaling as a whole has been a 'minor' actor in the grand scope of industrial production for over one hundred years.
In regards to the first part of your question, a lot of nations participated in industrial whaling, and I've found it difficult to provide a quantifiable "importance" that extends beyond "very!". For now, allow me to speak on the American whale fishery:
The American whale fishery had an ever present appearance in the national economy of the early United States (indeed, in the colonial period prior) - despite its major slumps in the Revolutionary and 1812 Wars - and had enjoyed massive growth from around the end of the War of 1812 until it's termed 'Golden Age', typically set lasting from the 1840s to 1850s). At it's physical peak, the American whaling fleet in 1843 boasted over 700 of the estimated 900 dedicated whaling vessels in the world at the time. It is commonly cited that the economic peak of American whaling took place in the early 1850s - where the industry ranked around fifth in profitability nationally, principally in the production and sale of whale and sperm oils, as well as the production and export of baleen.
Whale product has always been turbulent in it's profitability. For every major cash cow (cash whale?) vessel that came back to New Bedford, there was a ship returning empty handed, or at some amount of economic loss. The rewards in American whaling were tasty, enough to help the investors look past the very real risks. As cheery and positive the term 'golden age' might give, the development of less expensive, alternative, sources of oils and lubrication that whale oils monopolized were beginning to draw the money away from the hunt. Coal oils, petroleum, etc. were arriving, and their introduction was planting many thorns into the hide of the whaling industry.
Popularly (almost by tradition) the introduction of kerosene and petroleum has been pointed to as killing the American whaling industry. However, there is much scholarship that suggests that the industry was much more harmed by other developments, as much as the demand was decreasing, the ability to supply was falling as much. The movement of American workers to the West in the later 19th Century (a move prophesied almost by the mass whaler crew desertions to the California Gold Rush) and to the industrial factories on the rise took valuable labor from the decks of whale catching vessels. The better wages, and comparatively better living conditions, attracted men from the sea to the shore, investors found more stability in financing the land industrialization of the United States than in financing the still-risky whaling voyages. Whaling historians agree that this was a large factor in why Norwegians took up the harpoon when the Americans began to lay it down, as they seemed to be at something of an inverse. Norwegian whaling proposed more attractive wages to Norwegian workers, the labor pool was cheap to begin with (whereas the Americans' was rising), and the Norwegians were looking 'outward' whereas the Americans were looking 'inward'.
The 'Golden Age' was so successful that whale populations were massively harmed. There were so many ships, and so few whales. Stock numbers drove Americans to new ground - mainly Arctic - to hunt whales, but this was a venture that, at the point of profitability, many other international whalers had joined with similar cause. It becomes logical, then, that we find the whaling industry of the United States take such a sharp and violent decline in it's physical number and money making.
While you wait for more targeted answers, you might be interested in some previous threads on whaling and products produced from whales:
How profitable was whaling in its hayday? People seem to endured extreme exertions, like fishing at the polar circles, to get whales. - 6 comments, over 3 months old.
A commenter gives a sourced answer on 19th century whaling profits using examples annual profits, profits for a single trip, and profits made over the lifetime of a whaling ship.
How did whaling work? I imagine whales are pretty hard to catch with just harpoons. - 171 comments, over 2 years old.
This thread goes into detail on the Australian whaling industry, its techniques, and some of its economic contributions to Australia.
How effective of a fuel source was Whale Oil? - 1 comment, over 7 months old.
The lone comment is a sourced summary of the uses of whale oil from the 18th century into the mid 20th.
How rapidly did the New England whaling industry transition from sail to engine-based vessels? - 1 comments, over 1 year old.
This comment puts the rise of New England steamships in context with whale population changes, a "golden age" of whaling, new hunting grounds, and comparison with whaling industries abroad.
/u/an_ironic_username is flaired on this topic and might be able to give you a more targeted answer.