Legalism in Christian Theology, is the view that one places an over emphasized requirement on conduct and good deeds (while focusing on the Law instead of Grace by faith) as the only beneficial way one can obtain eternal salvation. In other words, legalists focus more on the Law than Grace.
There are two variants of legalism. The first is commonly held by cults (such as Jehovah's Witnesses and such) which mandate that keeping the law is a requirement for ultimate eternal salvation. This is generally rejected by most Christians. The other is commonly found within Fundamentalist groups, which goes beyond the belief that a Christian should conduct himself/herself in a Godly manner, and emphasizes certain requirements (e.g. men having short hair, not using alcohol or tobacco, avoiding secular movies or music) even to the point that failure to do so can result in removal from a congregation. This variant does not hold that doing so will result in loss of salvation, but that it presents a poor witness (or may be proof of lack of real salvation in the first place).