Depending on the network you are using, an ssh connection may drop (time out) if you don't do anything active on it for a while. This is easy to fix.
Ping
One approach is to run something like ping every ten seconds in a terminal window:
ping -i 10 myserver.example.com
Ssh config
A better approach, assuming you are using ssh on a Linux client, is to edit (or create) on the client:
$HOME/.ssh/config
and add the following line:
ServerAliveInterval 60
This will keep it active while the network connection is in place. You may still get dropped connections if the network connection is interrupted.