The title can be assigned by badges or groups.
Some badges can be use to add a (predefined) title. You can add a new badge, and set this badge to display a title.
Every user who grant the badge can add a (predefined) title from the profile page.
Go to /admin/badges
and create a new badge
You can use this query to grant the badge for all Trust-level 1 users (you can change the number for other trust-level)
SELECT user_id, granted_at
FROM user_badges
WHERE badge_id = 1
Trigger daily.
This is the easy way, and you can add more badges, see here What cool badge queries have you come up with?
There’s no way to let the users add a custom title. This is an ability reserved to admins and mods.