Thanks for all your replies. I do use the latest version. If I don't use the tunnel for browsing, my putty client can usually keep alive for several hours even when I don't use the computer, it doesn't seem to be caused by the connection between my server and my computer. My wild guess is when there are connection problems between my server and the website I'm browsing, sshd or putty can't handle it well, for example, it may use a very long time-out, or try to connect endlessly. I also found that, when browser and putty stops responding, if I close the browser, putty will recover after a while, which can confirm that my local connection has been good.
I will test keepalive more and report back later.