You can do this using JavaScript. Insert the below code using code injection within the product page. As @Paul2009 said, this won't prevent people from adding the max amount multiple times, or changing the number in the shopping cart, but it prevents people from adding more than the max via the product page's add-to-cart function.
Product page > Additional info > Code injection > [insert below] > Save
<script>
document.querySelectorAll("input")[0].setAttribute("max", "#");
</script>
Change "#" to whatever number to be. For example, if you don't want customers to be able to buy more than 3, your code would be:
<script>
document.querySelectorAll("input")[0].setAttribute("max", "3");
</script>
Hope this helps!