I don't know exactly what technique GitHub uses, but it's likely a cookie in your browser or some other sort of local storage. It is known that if you clear your cookies that the prompt will reoccur.
This technique exists to avoid problems with weak or compromised passwords which can lead to account takeovers. An attacker would have to have both the account password and access to the email account, which is somewhat more difficult.
There is no way to avoid this, since the goal is to ensure that you have more than just the password to log into the account. If you enable two-factor authentication, however, that will disable device verification, since you already have something more than just the password to log in.
Even if you don't care about your account's security, GitHub does, since compromised accounts are a source of abuse and spam. This is unfortunately a global problem on the Internet today.