Don't ask them to shut up; it's rude.
Keep yourself occupied, look uninterested, unapproachable.
But, on other occasions talk to them as you normally should, and maintain your friendship. Roommates are an important part of life. Do not leave a bad impression.
You hate the constant boring stories, not the person, and that message they should pick up eventually.
Use your body language.
Folded arms, blank look on your face etc. are examples.
See also: How to Ignore Someone
Find a reason to change room that doesn't hurt their feelings.
Speak to them about it.
If the abovementioned aren't really working or possible solutions, it's time you had a talk.
Next time, just briefly respond with something like this:
You have a lot of interesting stories to share, and sometimes I like them, but I'm normally more interested in listening to music (and other things) and to just sit back and relax, so I hope you don't mind if I get back to my music (or something).
And make sure you're not coming off as harsh when you say this.
I've lived in hostels in India, and shared apartments in Dubai. My roommates were great. Nevertheless, I get the idea.