Function that create more than 1000 record

For example

on leave policy, I have 4 types of leaves and i want to grant them to our employee when I click on Grant Leaves button I have 400 employees the button must create 1600 record in leave allocation

but here we have a problem system create first 1000 record after that show errors

What is the error?
Timeout?