Is there a rule of thumb for defining the scope and depth of the Related Work section in a thesis? This might be a generic question but I ask it for a case of a Master Thesis.

DO you have a rule of thumb for inferring the right amount and type of citations that go to your Related Work section.

Let's say in field A there is this problem X. And in literature there are two types of approaches to solve problem X: type1, and type2. My approach belongs to type1. Should I include works about type2 in the Related Work section too?

I found this post helpful.

However, I still find myself in doubt when writing the related work. Sometimes I feel I go a bit too far including stuff seemingly unrelated... 

Often, I loose the focus of the related work. 


What is its purpose in a thesis? To show what others have done, and how my work relates to that. Or give a general overview of the works that have been done in the field? 
Do I have to discuss and speculate in the Related Work? Or do I have to only list the other
works? 
Do I need to include results of the other works in my related
work?
The rule is to provide more details on those works that are most relevant to yours.  This is especially critical for those that seem to overlap with your work, or conceptually share similarities.  The most relevant ones are those whereby the problem is exactly the same, but your approach and others are different.  That means you need to cover these other approaches in detail.

For other not so relevant, you need to show you are aware of them.  Basically, you state, 'there are also works on blah, blah2, blah3.  However, this work is different because of x, y and z'.   Note that you go as far as providing the reference, and differences.  You might briefly state their aim(s).  

Remember, one key reason for a  literature review is to provide evidence that your work fills gaps in the literature.  So present whatever is needed to proof this point.