It really depends. If you like the subject and it won’t be too difficult for you, take the AP class, it can’t hurt. How your school’s GPA calculations work could also influence your decision: at my high school, an A+ in an AP class was a 5.0 for your gpa, not a 4.0, so it was often worth it to take the AP classes even if you’d struggle a little. That way you might learn more anyways.
The other thing you should really consider is what college you might go to. (If you’re a sophomore or a freshman, you can disregard this.) Even if you don’t know specifically, in my experience public colleges or universities are more likely than private colleges to give you credit for AP classes. My (private) school is only giving me credit for 2 of my AP classes from high school, and only as credits towards graduation, not to fulfill any General Education requirements or much else. In contrast, some of my high school friends who now go to public universities entered with Sophomore standing because of all the APs they took in high school.
If you think you might regret not having the credit, take the class. If you only want it for college credit, maybe taking it pass/fail so you can take the AP exam is a good choice. But most importantly, take it if US history is interesting to you, you’ve heard that the teacher is good, and you’re willing to do a little extra work. If the teacher is dismal, it’s not worth it. If you’ve always hated history, it’s not worth it. If you’ve always loved history, you probably won’t mind the extra work, so go for it!
Just my two cents.
-A current college student who loved her AP classes in high school