They are different my friend. You can say, "on my mind" refers more to what's presently on your mind while "in my mind" is something that has been there for some time. So:
- In my mind means what you think; it means: in your brain, in your head, in your view etc.for example : I have a picture IN MY MIND of a beautiful green valley ;).
- On my mind is something about which you are concerned or worried.
for example: I constantly worry about paying the bills. It's always ON MY MIND.
I hope this could help you.
:)