If something is on your mind,you are worried or concerned about it.
If you ask someone what they have in mind,you want to know more details about an idea they have.
If you say that someone is out of their mind,you mean that they are mad or very foolish.