Hello,
Depending on how many rows there are, you are making a call to the sheet to get data for every row, plus every cell. That is very inefficient and could cause problems if Google's system is busy, or someone else is working on the same Spreadsheet, etc etc. You can pull the whole data range into an array, and work with memory instead of making all the data calls to the sheet--so you only make a single call to all the data. Something like this code will be much more efficient and much faster.
Keep in mind, creating many new Documents can take a long time just by itself. But this should be 1/10th (or faster) the previous speed.
function Creator() {
// this is a template file
const docFile = DriveApp.getFileById("1jsPQjkz4eXImbPMCQmO48LRg2gPiN6mIIx5A9nzLTOw");
// this is the directory for new files
const tempFolder = DriveApp.getFolderById("1wfcoEm1YbOgWV1ZNZUCM4PElc5DawzoK");
var list = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
//we determine the number of rows
var lastRow = list.getLastRow();
var data = list.getRange(2, 2, lastRow -1 , 8). getValues() //ensure this range is correct. from second row, second column down to last row, 8th column
var a1 = data[0][0]
//take the values of the columns from the table
for (var i=0; i < data.length -2; i++) { //may need to change '-2' to '-1' if last row is skipped
//these variables are not needed, but you can keep them if it helps understand the function better
//var a2 = list.getRange(i, 2).getValue();
var a2 = data[i][2]; //or don't use at all (see below)
//var a3 = list.getRange(i, 8).getValue();
var a3 = data[i][8]; //or don't use at all (see below)
//var a4 = list.getRange(i, 7).getValue();
var a4 = data[i][7]; //or don't use at all (see below)
//var a5 = list.getRange(i, 5).getValue();
var a5 = data[i][5]; //or don't use at all (see below)
//var a6 = list.getRange(i, 3).getValue();
var a6 = data[i][3]; //or don't use at all (see below)
//var a7 = "действующий(ая) на основании Уведомления о постановке на учет физического лица в налоговом органе"
//var a8 = list.getRange(i, 6).getValue();
var a8 = data[i][6]; //or don't use at all (see below)
// make a copy of the template
const tempFile = docFile.makeCopy(a2, tempFolder); //or const tempFile = docFile.makeCopy(data[i][2], tempFolder);
// open the created copy
const tempDocFile = DocumentApp.openById(tempFile.getId());
// copy file body:
const body = tempDocFile.getBody();
//replacing values in the template:
body.replaceText("{ФИО}", a2); // or body.replaceText("{ФИО}", data[i][2]);
body.replaceText("{ДАТА}", a3); // or body.replaceText("{ДАТА}", data[i][8]);
body.replaceText("{РЕКВИЗИТЫ}", a4); // or body.replaceText("{РЕКВИЗИТЫ}", data[i][7]);
body.replaceText("{КОНТАКТЫ}", a6); // or body.replaceText("{КОНТАКТЫ}", data[i][3]);
if(a5 == 'ИП'){ // etc etc or if(data[i][5] == 'ИП'){
body.replaceText("{ОБРАЩЕНИЕ}", "Индивидуальный предприниматель");
//a7 can be deleted and replaced directly with the text:
body.replaceText("{ОСНОВАНИЯ}", "действующий(ая) на основании Уведомления о постановке на учет физического лица в налоговом органе");
body.replaceText("{ОГРН}", a8); // or body.replaceText("{ОГРН}", data[i][6]);
body.replaceText("{ПОДПИСАНТ}", a2); // or body.replaceText("{ПОДПИСАНТ}", data[i][2])