Help: How to Hide Object after conditions are met?

I have a button that adds new input fields every time it’s clicked. I would like the button to go away or ‘hide’ after adding 3. How can I achieve this?