Which variable to set for programmatically making a field required?
Get the form_id of that form and write an alter function for it in your custom module. 

function hook_form_form_id_alter() {
 $form['that_field_name'] = array(
   '#required' =&gt; TRUE,
    // add other features you want to add
 );
} 


Follow the below link for more details:
https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_form_FORM_ID_alter/7