I'm exactly like you. I can just think for hours. Sometimes at the end of the day I wonder what I did and I can't find an answer, I spent almost all day wondering in my mind.
It can be a problem sometimes as you said, since I can't really pay attention in class, when someone is talking to me, reading a book, etc.