The Mozart Effect suggests that listening to some types of music can help with certain mental tasks. However, there's a case to be made for working or studying in silence, too. Some research shows that for certain cognitive tasks, you need quiet more than anything.
According to the Atlantic, "for most types of cognitively demanding tasks, anything but quiet hurts performance." They cite a number of studies, including this one from Glasgow Caledonian University. In it, researchers asked subjects to perform a series of cognitive tasks with different kinds of noise in the background. They reported:
Forty participants completed five cognitive tasks: immediate recall, free recall, numerical and delayed recall, and Stroop...Performance was lessened across all cognitive tasks in the presence of background sound (music or noise) compared to silence.
Some studies do show that music can help with certain tasks, but those tasks usually don't require a lot of cognitive demand. One neuroscientist told the Atlantic:
"Most of what a brain surgeon spends their time doing is drilling through the skull bone," said Daniel Levitin, a neuroscientist and author of This Is Your Brain on Music. "In that case, it's a situation like being a long-distance truck driver. If nothing goes wrong, the task itself is somewhat boring and repetitive, so you need something that will keep you psychologically aroused."
What's more, if the music is engaging (in other words, it has lyrics), it's even worse for your concentration. Again, it depends on the task, and your own mileage might vary. If music works for you, you should do what works. But silence might be worth a try. For more detail, read the Atlantic's full post at the link below.
The Best Music for Productivity? Silence [The Atlantic]