According to the federal system, prisoners who have demonstrated “exemplary compliance with institutional disciplinary regulations” can get up to 54 days per year off their sentences! (18 U.S. Code § 3624(b)).
American prisons have been letting out well-behaved inmates early since 1817.
In terms of what is considered “good behavior”, common things include making the bed, showing up for the head count, and keeping bodily fluids to yourself. Essentially, refraining from prohibited behaviors (which is quite an extensive list actually).
For more information on this topic, check out this article.