While titles aren't traditionally considered a specific part of speech, they function like adjectives in a sentence. They modify a noun (the person's name) to provide more information about them.
For example:
* Mr. Smith arrived late. ("Mr." modifies "Smith" to indicate he is a male).