There are three name types in any user's account settings:
Full Name: used for the Gradebook and Grades pages.
Display Name: how other users will see the name in Discussions, Announcements, and Conversations.
Sortable Name: defaults to the "last name, first name" format and is how the name appears in sorted lists.
Some examples of when you may want to have a name type listed differently can be found below. To change any of these names, have the user navigate to their account settings page as shown below and click "Edit Settings" to edit any of the name types.
If your students' names are not appearing in the order they should be in the gradebook, it is likely that their Sortable Name needs to be updated.
If you would like your students to see your name as with the proper salutation (i.e., Mr., Ms., Mrs., etc.), update your Display Name.
If a student has entered a nickname or other inappropriate name instead of their real name, their Full Name should be updated first and then the rest of the names will auto-update to follow suit.