The simple explanation is that “important to” is something you value, while “important for” is something you need, or that will help you in some way.
A nice example is:
“It is important for you to get well” ~ your life will be improved by returning to health
“It is important to your family that you get well” ~ they put a high value on you being healthy.
There is a large grey area, particularly if you are talking about personal experiences. Passing an exam, for example, is something you put a high value on (or you would never have started the course) and will also benefit you in terms of career. In this case, it is ‘important to’ and ‘important for’ you.