The hanging chains weight gets balanced by the friction by the chain lying on the surface.
Mass per unit length will be ml
So the weight of hanging part will be mlgx
And the friction provided by the chain lying on the surface will be μmlg(l−x)
Both the forces will be equal,
So,
μmlg(l−x)=mlg(x)
x=μμ+1lunits