Secretary-General Jens Stoltenberg said the costs of war were high, but the price of letting Moscow achieve its military goals was even greater.
His comments came as UK Prime Minister Boris Johnson also warned of the need to brace for a longer-term conflict.
Both Mr Stoltenberg and Mr Johnson said sending more weapons would make a victory for Ukraine more likely.
“We must prepare for the fact that it could take years. We must not let up in supporting Ukraine,” the Nato chief said in an interview with German newspaper Bild.
“Even if the costs are high, not only for military support, also because of rising energy and food prices.”
The Western military alliance chief said that supplying Ukraine with more modern weapons would increase its chances of being able to liberate the country’s eastern Donbas region, much of which is currently under Russian control.
For the last few months Russian and Ukrainian forces have battled for control of territory in the country’s east – with Moscow making slow advances in recent weeks.
Writing in the Sunday Times, British Prime Minister Boris Johnson accused Russia’s Vladimir Putin of resorting to a “campaign of attrition” and “trying to grind down Ukraine by sheer brutality.”
“I’m afraid we need to steel ourselves for a long war,” he wrote. “Time is the vital factor. Everything will depend on whether Ukraine can strengthen its ability to defend its soil faster than Russia can renew its capacity to attack.”
The prime minister, who visited Ukraine’s capital on Friday, said supplies of weapons, equipment, ammunition, and training to Kyiv needed to outpace Moscow’s efforts to rearm itself.