As a rule of thumb, you generally want to withhold enough to avoid underpayment penalties, but not too much that you receive a large refund at the end of the year.
In order to avoid an underpayment penalty, the government expects to have received the lesser of 90% of the taxes you owe by the end of that year or an amount equal to 100% of your tax liability for the previous year.
As for your refund, since the government does not pay you interest on any excess withholdings you may have paid during the year, you are essentially providing them with an interest free loan that they pay back via your refund. As this money could have been put somewhere accruing interest, you’ll quickly notice that this excess payment is not the best use of funds.
The IRS provides the following Tax withholding calculator to help you determine how much you should be withholding.