How to get the value of a custom field in hook_node_presave?
You can't get the value in the hook_node_presave() because this is not a node field, as you says is a custom field that you create altering the form.

In this case you need to add a custom submit handler to use the value, something like this inside the hook implementation:

function custom_assignments_form_alter(&amp;$form, $form_state, $form_id) {
// ...
  if (isset($form['actions']['save_continue']['#submit'])) {
    array_unshift($form['actions']['save_continue']['#submit'], '_node_revision_delete_form_node_type_submit');
  }
// ...
}


And in the function you can access to the value and perform your actions

function _node_revision_delete_form_node_type_submit(array &amp;$form, FormStateInterface $form_state) {
// Getting the form values.
  $field_after_lecture_tmp = $form_state-&gt;getValue('field_after_lecture_tmp');
}