I don't use gmail anymore for some time, but as far as I know, you have to set an "app password" or something like that. Did you set that? Because it won't work with your normal user password.
Also, you could check the logs Vikunja produces to see what the problem is. Is it really a timeout or maybe something else?