Connection has timed out

Hi, I am using Team viewer for educational purposes to simulate my work on a remote server. I get many problems regarding connection with the server. Many times I receive a message saying there is no connection or the connection has timed out when I try to connect to the server. What might be the problem?

Thanks in advance.