Unless you have very old trusted devices, or unless your account isn't eligible, users are encouraged to switch from two-step verification to two-factor authentication, which is a bit different (and better). Confirm which feature you're using. Two-step verification uses 4 digits, two-factor authentication uses 6 digits for the the verification code. Two-factor authentication can’t be turned off (temporarily), after the first two weeks.
_______________
If you have an Apple TV (2nd or 3rd generation) and two-factor authentication for your Apple ID, then you may be asked to type your password followed by the six-digit verification code directly into the password field. Additionally, there is a time limit, after which the code becomes invalid.
Try this: First enter the characters of your password (do not submit yet), then manually request a new verification code, then append that code to the password (no spaces or other separating characters), and then submit. That should help you get passed the time limit.
This procedure isn’t needed with the Apple TV app among the apps on a smart TV. On modern devices you will be promoted for the verification code separately.