If you’re successful in catching the Raid Pokémon, it’ll be added to your Pokémon Storage. However, if you run out of Premier Balls before catching the Pokémon, it’ll flee, and you’ll miss your chance for that particular Raid. Use the Premier Balls as carefully as possible and you should be able to catch that five-star Legendary Raid Pokémon when the opportunity arises.