When you buy or transfer cryptocurrency on Kraken the exchange will keep the crypto in a wallet. However it is recommended that you never leave crypto sitting idle on an exchange. Regardless of how secure it is. It is better to transfer your crypto onto a hardware wallet for better security.