The words legalistic and legalism are not found in most translations of the Bible (Philippians 3:6 is a notable exception), however the concept of legalism and legalist practices are found throughout the Bible, especially the New Testament.
Essentially, legalism is to strictly follow a set code of behavior (that is, laws or rules) at the expense of something more important, such as loving God or treating others right.
In the Bible, the Jews, especially the leaders, were criticized for their legalistic behavior. This was all the more prevalent in the New Testament, where Jesus was particularly harsh on the Jewish leaders (the Pharisees and the Sadducees).
For some examples, see Mark 7:8-13, Luke 11:42, and Matthew 23:16-28.
A lifelong student of the Bible, Peter DeHaan, PhD, wrote the 1,000-page website ABibleADay.com to encourage people to explore the Bible. His main blog and many books urge Christians to push past the status quo and reconsider how they practice their faith in every area of their lives.