The NFL requires that three years pass between a player graduating from high school and declaring for the draft. While this can include a 'Redshirt' year in which a player does not play in competitive games but practices with a college team, so often players are draft eligible by their 'sophomore' year.
You can read up on the rules in full here, however the three year cutoff is a bit buried in the legalese. You'll find a much more succinct summary of the eligibility guidelines as actually applied, given the various ease of access to things like commisioners waivers on the relevant Wikipedia page.