Everything is tied to your account and to a minor extend, your Xbox One.
As long as you have access to your account, you can always re-download and replay all of the games you own digitally as well as all savegames that were saved to the cloud. As you sold your console, I'd also suggest you change your account password or the owner of your old console may have access to your account.
The Xbox One was the first console to let you set a Home Console. What that meant is that, on this console, all other tags on that console could play your content, as in your digital library, even if your tag wasn't logged into that console. This also holds true for sharing your Gold membership.
However, once you get a new console with that feature (Xbox One family), you can log in with your account and then set that console as your home console. It will then be revoked from the other console as you can only have at most one Home Console.