An app is always open in the background

How can I make the app always stay open in the background?
I need to play music at time X even if the app is closed.

Can u explain how I use it? I want to make sure that even if the app is closed and X seconds / minutes have elapsed it will play music.