If your Xbox Game Pass subscription expires, the game will remain installed, but you won't be able to play it until you either resubscribe or purchase the game. You don't get to keep games you download via Xbox Game Pass—you lose access to them when your subscription stops.