Yeah, Digital Wellbeing and Parental Control. It's there in your phone (pre-installed). Just go to the Settings app and search for it. If it's not there, you can download it from Google Play Store.
If you get there, you can set limits on the desired app. When you reach the limit, a pop-up window will appear saying you've exceeded the app usage limit.
You, also, can have a record on your total screen time and screen time for particular apps too. And, you can set restrictions, parental controls and so on.