A glue gun can stay on and plugged in for as long as you are using it and I've had my glue gun on for an hour at a time when I was doing crafts and projects.
However once you're done using the glue gun you should unplug the glue gun and never leave the glue gun unattended because it can catch things on fire.
Always unplug the glue gun when you're done using it.
A glue gun can take between 2 to 4 minutes to fully heat up and melt the glue depending on the size of the glue gun.
My large glue gun takes 4 minutes of being on before it heats up enough to allow the glue to melt and glue the stuff together.
My smaller glue gun takes only 2 minutes to be heated up enough to allow the glue to melt and come out and be hot enough to melt and glue the stuff together.