You can claim and enter the actual amount of your qualified education expenses, even if they exceed $4,000. However, the amount of the American opportunity credit is limited to $2,500 per student, and this maximum is attained with $4,000 of qualified education expenses.
Please read this IRS article for more information.
Q. How do I claim more than $4000 in tuition?
A. You don't. The maximum American Opportunity Tax Credit (AOTC) is $2500. It only takes $4000 of tuition and other qualifying expenses to get the maximum $2500 AOTC.
So, there is no need to enter more. That said, the TurboTax (TT) program will let enter more than $4000. It just won't do anything with it. Note that line 27 of IRS form 8863 says "Adjusted qualified education expenses (see instructions). Don’t enter more than $4,000" .