diff --git a/core/includes/common.inc b/core/includes/common.inc
index 654d849..34af4ca 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -4703,7 +4703,8 @@ function drupal_cron_run() {
   $GLOBALS['user'] = drupal_anonymous_user();
 
   // Try to allocate enough time to run all the hook_cron implementations.
-  drupal_set_time_limit(240);
+  $time_limit = config('system.cron')->get('treshold.time_limit');
+  drupal_set_time_limit($time_limit);
 
   $return = FALSE;
   // Grab the defined cron queues.
@@ -4711,7 +4712,7 @@ function drupal_cron_run() {
   drupal_alter('queue_info', $queues);
 
   // Try to acquire cron lock.
-  if (!lock()->acquire('cron', 240.0)) {
+  if (!lock()->acquire('cron', $time_limit)) {
     // Cron is still running normally.
     watchdog('cron', 'Attempting to re-run cron while it is already running.', array(), WATCHDOG_WARNING);
   }
diff --git a/core/modules/system/config/schema/system.schema.yml b/core/modules/system/config/schema/system.schema.yml
index d41d414..0a796f2 100644
--- a/core/modules/system/config/schema/system.schema.yml
+++ b/core/modules/system/config/schema/system.schema.yml
@@ -75,6 +75,9 @@ system.cron:
         requirements_error:
           type: integer
           label: 'Requirements error period'
+        time_limit:
+          type: integer
+          label: 'Cron runtime time limit'
 
 system.date:
   type: mapping
diff --git a/core/modules/system/config/system.cron.yml b/core/modules/system/config/system.cron.yml
index 7d404e1..64acb02 100644
--- a/core/modules/system/config/system.cron.yml
+++ b/core/modules/system/config/system.cron.yml
@@ -2,3 +2,4 @@ threshold:
   autorun: '0'
   requirements_warning: '172800'
   requirements_error: '1209600'
+  time_limit: '240'
\ No newline at end of file
diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc
index 8c14060..33d7d4a 100644
--- a/core/modules/system/system.admin.inc
+++ b/core/modules/system/system.admin.inc
@@ -1560,11 +1560,29 @@ function system_cron_settings($form, &$form_state) {
     '#default_value' => config('system.cron')->get('threshold.autorun'),
     '#options' => array(0 => t('Never')) + drupal_map_assoc(array(3600, 10800, 21600, 43200, 86400, 604800), 'format_interval'),
   );
-
+  $form['cron']['cron_time_limit'] = array(
+    '#type' => 'number',
+    '#title' => t('Time limit'),
+    '#description' => t('Set the cron execution time limit in seconds. If set to zero, no time limit is imposed.'),
+    '#default_value' => config('system.cron')->get('threshold.time_limit'),
+    '#min' => 0,
+    '#step' => 1,
+    '#suffix' => t('seconds'),
+  );
   return system_config_form($form, $form_state);
 }
 
 /**
+ * Form builder validate handler; Handle validation for cron settings.
+ *
+ * @ingroup forms
+ */
+function system_cron_settings_validate($form, &$form_state) {
+  // Check if the time limit is set to a valid value and to a minimum of 30 seconds.
+  if ((!is_numeric($form_state['values']['cron_time_limit'])) || ($form_state['values']['cron_time_limit'] < 30)) {
+    form_set_error('cron_time_limit', t('Please enter a valid time limit with at least 30 seconds.'));
+  }
+}
+
+
+/**
  * Form builder submit handler; Handle submission for cron settings.
  *
  * @ingroup forms
@@ -1573,6 +1591,7 @@ function system_cron_settings_submit($form, &$form_state) {
   config_context_enter('config.context.free');
   config('system.cron')
     ->set('threshold.autorun', $form_state['values']['cron_safe_threshold'])
+    ->set('threshold.time_limit', $form_state['values']['cron_time_limit'])
     ->save();
 }
 
