Your sheriff noble gets promoted to Captain of the Guard at a population of 50 dwarves, along with the expedition leader's promotion to Mayor. If you have managed your Fortress up to this point without a sheriff, the position of the Captain of the Guard will be vacant and you can assign one. The current Sheriff/Captain can still be removed from office and the post once again be vacant.
The Captain of the Guard leads the fortress guard, which aids the Captain in the enforcement of justice. Assigning dwarves to the fortress guard delights the Captain, and is important to ensure that justice is dispensed in a timely manner. This, in turn, is important because if justice is not dispensed quickly by the guard, the Hammerer will do the job instead.