It is the first nationwide truce agreed since 2016 in a war which has killed nearly 400,000 people, according to UN estimates.
About 60% died from hunger, lack of healthcare and unsafe water.
The deal between the Saudi-led coalition and Iran-backed Houthi rebels - which can be extended if both agree - came into effect at 16:00 GMT on Saturday.
Saturday is the first day of the Muslim holy month of Ramadan for many Muslims.
US President Joe Biden hailed the UN-brokered truce as a long-awaited "reprieve for the Yemeni people".
But he added: "These are important steps, but they are not enough. The ceasefire must be adhered to, and as I have said before, it is imperative that we end this war."
The truce announcement was made by the UN special envoy Hans Grundberg on Friday, on the second day of peace talks in Riyadh, Saudi Arabia.
"The parties accepted to halt all offensive military air, ground and maritime operations inside Yemen and across its borders," his statement said.
Fuel ships will be allowed passage into the rebel-held port of al-Hudaydah on the Red Sea, and commercial flights will be able to operate from the airport in the rebel-held capital Sanaa. Roads into the besieged south-western city of Taiz would also be opened, said the UN envoy.
UN Secretary General Antonio Guterres urged all sides to implement the agreement as soon as possible.
The Saudi-led coalition backing Yemen's official government has been fighting the Houthis for the past seven years, using mainly air strikes.
The Houthis, in turn, have used drones and missiles to attack both Saudi Arabia and its ally, the United Arab Emirates.