How to avoid thinking about research in free time?
I agree with @PeterJanson's answer, but I'd like to add my 2 cents on it:
Often, I find myself "constantly" thinking about a problem when I'm stuck or I'm not sure how to approach it. Often, it's because I've got tunnel vision on the problem. That is, I'm only thinking about it from a limited number of perspectives and can't think of other possible approaches to the problem. I used to spend long hours thinking about a problem (even outside of normal work hours) without ever really getting anywhere on it.
When that happens, I find it's good to pursue other activities that stimulate my brain to think outside of the box. That could be anything from reading semi-related research papers to playing video games to engaging in stand up comedy! When I challenge my brain to approach other problems from new perspectives, I find those same skills help loosen my brain to engage in research in new ways as well.
While I never really stop thinking about research, I find these other activities help me engage in research with fresh eyes and renewed energy. And ultimately, that has lead me to better research results and liberates me from "overthinking" the problem during my leisure time.
I believe it comes with the territory. Since being involved in research means exercising your imagination and intellect, it is hard to stop the stimulation. I personally have no problems relaxing from my research when I do other stimulating activities such as hobbies. I personally do not find thinking about my research much of a problem but I have noticed that I have a tendency to start thinking more about my science when I am in the company of what I might consider dull people. That will probably make me seem dull too!
I try to look at it, and explain it, by comparing with an elite athlete, you need to keep at it constantly to be on top. Many can see and appreciate the (intellectual) similarities.
You don't ever stop thinking, much in the way that you shouldn't tell someone to stop feeling sad/angry/upset/whatever. But, if there are actions you're doing that interrupt your relationships with others, you can take steps to try to reduce the effect of these actions.
Instead of trying to not think about research, I would try to curb activities that you may act upon as a result of thinking about research.
Keep a notebook on you that you can quickly write your thoughts down in. Dump your brain in about a minute and then move on with whatever you're supposed to be doing. The key word here is quickly - you don't want this to turn into a five minute exercise.
Concentrate heavily on what you're currently doing and focus. Easier said than done, but the key is not to let yourself get distracted with your thoughts. Even if you're not fully focused, try your best to appear focused.
Limit your discussions about research with others if they're not interested in them.
Excuse yourself if you want to think or write more in a way that might appear rude or inappropriate to others. Thus, rather than trying to write things down extensively while in the middle of a nice dinner, excuse yourself, go to the washroom, and write things down there. If you're out walking and get a great idea that you want to think about, ask to stop for a break and think then.
I think the key point here is to differentiate the things that you can control (your actions) compared to things that are much more difficult to control (your thoughts) and to ensure that your behaviors are not disturbing others. Take time for yourself too!