The ban will not apply to all Russian music, but rather relates to music created or performed by those who are or were Russian citizens after 1991.
Artists who have condemned Russia's war in Ukraine can apply for an exemption from the ban.
The import of books from Russia and Belarus will also be prohibited under the legislation.
Many of those living in areas of east and south Ukraine have historically felt a strong connection to Russia, often speaking Russian as their first language.
But Russia's invasion of Ukraine has led many Ukrainians to want to separate themselves from Russian culture.
The bill, approved by MPs on Sunday, bans some Russian music from being played or performed on television, radio, schools, public transport, hotels, restaurants, cinemas and other public spaces.
It secured support from 303 of the 450 deputies in the Ukrainian parliament.
The document says the ban will "minimise the risks of possible hostile propaganda through music in Ukraine and will increase the volume of national music products in the cultural space," BBC Monitoring reports.
The ban will apply to musicians who have or had Russian citizenship at any time after 1991 - the year Ukraine declared independence - except for those who are Ukrainian citizens or were so at the time of their death.
This means the works of long-dead Russian composers such as Tchaikovsky and Shostakovich can still be performed.
Russian artists who condemn the war in Ukraine can apply for an exemption for their music by submitting an application to Ukraine's security service. In it, they must state that they support the sovereignty and integrity of Ukraine, call on Russia to immediately stop its aggression against Ukraine, and undertake to refrain from any steps that contradict these written statements, the BBC's Ukrainian Service reports.
The document also includes laws to increase the share of Ukrainian songs played on the radio to 40%, as well as increasing the use of Ukrainian in daily programmes to 75%, Ukraine's public broadcaster (Suspilne) reports.
In a parallel bill to that affecting music, books imported from Russia, Belarus and occupied Ukrainian territories will also banned, as well as material in Russian imported from other countries.
This law will ban the publishing and distributing of books written by Russian citizens (with similar exemptions to those for music) though this will not apply to books already published in Ukraine.
In addition, translations of books will only be published in Ukrainian, official EU languages or indigenous Ukrainian languages.