A gray shirt refers to a player who commits to play for an NCAA division 1 football program, but agrees to pay his own way through school for a semester to preserve his eligibility. By paying his own tuition, he does not cost the school one of their limited scholarships.
Gray shirting occurs because schools often sign too many players to scholarships. A football team is allowed 25 scholarship players per year, and 85 total on the entire team. Because teams do not know in advance how many players that are offered scholarships will accept the offer, they typically offer more scholarships than they have available. If an unexpected number of players accept the scholarship offers, the school needs a way to mediate the oversigning.
In some cases, players are taken off scholarship. However many schools first ask new players to gray shirt for a year so that they can still join the team thereafter. The player enrolls in the university as a student, but does not officially become a scholarship football player until January. At this point, they are given a scholarship, but this counts against the following year's limit, rather than the current year. This lets the school maintain extra depth on the team, sign all the players it wants and avoid violating NCAA rules.