Let's tackle these one by one:
It's very important for me/to me to study abroad.
Here both can be used, but they would have slightly different meanings:
- "To me" means that you're the one who cares about it, while "for me" doesn't necessarily mean that it's important to you - it could be that it's important because of somebody else.
To better understand the difference, let's add "My dad thinks":
"My dad thinks it's important for me to study abroad."
...means he thinks it'll be a good thing for me.
"My dad thinks it's important to me to study abroad."
...means he thinks I care about studying abroad.
For me/to me all that matters is how much it will cost.
- First off, I would say the word order here could be improved: I'd recommend going with "All that matters to me/for me is how much it will cost". The order you used puts a stress on the first part: I'd expect to see these sentences in comments such as "I know you care about the time it'll take, but for me/to me all that matters is how much it will cost."
Secondly, technically the same rule as above also applies here: "to me" means directly to you, "for me" might mean that others are the ones who care, though in this case this difference is very small, and somehow the "for me" sounds a tiny bit worse or more awkward. So:
All that matters to me is how much it will cost.
= eg. I don't care about the time it'll take, I just care about the price.
You are the most beautiful girl, at least for me/to me.
- In this case, only "to me" sounds good. Perhaps somewhat because of the distinction noted above - we're talking about the speaker's opinion.
In the second version, let's add on a beginning:
"My mother thinks you are the most beautiful girl for me."
Here - and this is a reach - but it could technically be understood to mean that my mother thinks this girl is the prettiest I can find, though there are prettier ones out there in general
I imagine some might use such a sentence as a concatenation of two ideas: "you are the most beautiful girl" and "you are the girl for me", but technically this would not be correct.
On the other hand, in this sentence:
You are the perfect girlfriend, at least for me/to me.
...the better option would probably be the first one, but again, there would be a slight change in meaning:
"...for me" would mean that I'm acknowledging that while others may also have (near)perfect girlfriends, my specific needs, character, interests, etc. mean that you are the one who is perfect for me. However, note that the girlfriend would prefer to hear this as "You are the perfect girlfriend for me"
"...to me" could be understood to mean something along the lines of, You weren't (or aren't...) the best girlfriend for your other boyfriends, but I think you're perfect. That said, in this case you can't skip the "at least" - it wouldn't sound good without those two words.
To summarize, no wonder you're having problems, because there's a lot of nuances! But I hope this will have helped a bit :)