assuming you're playing USM, the Ultra Beasts' catch rates are all different in SM

You have a 2.126% chance of capturing it per ball. Thus, you have at least a 50% chance of catching it within 33 balls and at least a 95% chance of catching it within 140 balls.

With 1 HP

You have a 4.832% chance of capturing it per ball. Thus, you have at least a 50% chance of catching it within 14 balls and at least a 95% chance of catching it within 61 balls.

With Roto Catch Power

You have a 4.225% chance of capturing it per ball. Thus, you have at least a 50% chance of catching it within 17 balls and at least a 95% chance of catching it within 70 balls.

Asleep

You have a 4.225% chance of capturing it per ball. Thus, you have at least a 50% chance of catching it within 17 balls and at least a 95% chance of catching it within 70 balls.

With 1 HP and Roto Catch Power

You have a 9.608% chance of capturing it per ball. Thus, you have at least a 50% chance of catching it within 7 balls and at least a 95% chance of catching it within 30 balls.

With 1 HP and asleep

You have a 9.608% chance of capturing it per ball. Thus, you have at least a 50% chance of catching it within 7 balls and at least a 95% chance of catching it within 30 balls.

With Roto Catch Power and asleep

You have a 8.401% chance of capturing it per ball. Thus, you have at least a 50% chance of catching it within 8 balls and at least a 95% chance of catching it within 35 balls.

With 1 HP, Roto Catch Power, and asleep

You have a 19.101% chance of capturing it per ball. Thus, you have at least a 50% chance of catching it within 4 balls and at least a 95% chance of catching it within 15 balls.

source