It can have many meanings. One is you are physically far away from something or another person, and the distance is being exaggerated:
"My girlfriend is only away at University, but it feels like she is a million miles away."
Another can be you are "out of it" - not conscious of what is going on around you.
"I asked him a question, but from his blank gaze it was obvious he was a million miles away."