Hi Neha,
It is using TimeoutNoTransfer which is set in FTP server, the default value for this is 300 seconds 
TimeoutNoTransfer
The TimeoutNoTransfer directive configures the maximum number of seconds a client is allowed to spend connected, after authentication, without issuing a command which results in creating an active or passive data connection (i.e. sending/receiving a file, or receiving a directory listing). See Also: TimeoutIdle, TimeoutLogin
Regards,
Praveen.