When a user interacts with your website, look at the date of the last time you updated its gold amount. If it's more than 1 hour, increment the amount of gold of the number of hours passed since it's last interaction, and update the stored date.
You may do some optimisation on this principle to avoid testing it at each user request during a session (use a cache, of store the date in the session).
Update: store the next update time instead of the last, to avoid multiple calculations (that is to say store the timestamp of the current update + 1 hour). And then compare current time to the stored time.