I run "gcloud auth login" and then do some stuff, but after some time (~1hr or so) I have to run it again because otherwise I am not authenticated.
Is it normal? Can gcloud authentication remember me for a longer period?
It's not expected behavior, no. As per the documentation
Your credentials do not expire (i.e. you should not need to re-run this command), but you can repeat this process as many times as you'd like to add more accounts.
I'd recommend making sure that you're not clearing or deleting any of the following directories, as this is where everything is stored:
All credential information is stored in the directory $CLOUDSDK_CONFIG/credentials (or %CLOUDSDK_CONFIG%\credentials on Windows), where CLOUDSDK_CONFIG=$HOME/.config/gcloud on Linux and Mac, and %APPDATA%\gcloud on Windows.
Also, try listing and setting the appropriate accounts with the commands recommended on the linked document.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With