Kind of both actually.
It links the purchase to your account and the Xbox 360. Because of this, you can play when you are logged into Xbox live (because it's linked to your gamertag), and also offline (because it's linked to your Xbox).
If you purchase a new Xbox 360, or you need a replacement one, then you can once again download the game (for free, as you've already paid). However, you won't be able to play it unless you are signed into the gamertag, because the purchase is still linked to the old Xbox. Other offline profiles on your console will not be able to play because they aren't using the same gamertag OR xbox console as was originally purchased.
I've probably made that sound more confusing than it actually is!