The verification codes are uniquely crafted for your account when you need them, using the Google Authenticator (or similar) mobile app.
Obviously, we advise that you install the app on the mobile device that you are going to use prior to starting configuring the Two-Step Verification feature.
Each code can only be used once.
Google Authenticator (or similar) can generate verification codes even if you don't have an Internet connection or mobile service.
Related topic