This happens because your server stops execution after a certain time. You will need to increase the PHP timeout. Follow the methods below:
Method 1: Edit wp-config.php file: You will need to add the following to wp-config.php:
Method 2: Edit file .htaccess: Make sure to back up .htaccess before you edit it.
After backing it up add the following to .htaccess:
php_value max_execution_time 300
Method 3: Edit php.ini: Add the following to php.ini:
max_execution_time = 300