You can define a limit for the number of rows in the cart in Catalog Settings > Quote Cart:
If you set the limit, the user will not be able to add more products to the cart once the limit is reached.
The ‘cart limit text’ will appear instead of the add to cart button.