Proper way to alter field value from submit handler
Consider using the Force Password Change module which can already keep track of that.

First, add your custom submit handler to the beginning of the submit handlers array and not to the end, to ensure you &quot;inject&quot; the data before the user entity gets saved.
/**
 * Implements hook_form_FORM_ID_alter().
 */
function MYMODULE_form_user_form_alter(&amp;$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  array_unshift($form['actions']['submit']['#submit'], 'user_form_submitted');
}

Second, depending a little bit on what field type exactly you added to the user entity, the form value needs to be an array of values. In the sample below I used a simple plain textfield to store the data.
function user_form_submitted(&amp;$form, \Drupal\Core\Form\FormStateInterface $form_state) {
  $form_state-&gt;setValue('field_password_changed', [['value' =&gt; 'test22']]);
}

Third, you somehow need to check if the password got changed at all or if just the user form got submitted. Again, have a look at the force_password_change.module to get an idea of what exactly you may need to check for.