You're allowed to keep up to 3 players and each player you're allowed to keep up to 3 years.
Every year you keep a player, his keeper round escalates by 1. Meaning that if you draft a player in the 3rd round, you can keep him for a 3rd in the 1st year, a 2nd in the 2nd, and then a 1st in the 3rd and final year.
The one exception to this is your franchise player, which is a rookie from the previous season you're allowed to keep at their original draft slot in perpetuity. You're allowed to designate one franchise player out of your 3 keepers.
Undrafted free agents can be kept for a final round pick and players that were drafted and released descend a round every time they clear waivers so if a guy who was drafted in the 8th round was released and then cleared waivers 4 times before being picked up, he could then be kept for a 12th rounder.