It's a risk. It's generally not a great idea to purchase tickets before you apply for the visa, as the application could take longer than expected, you could get denied, or something like that. That said, however, plenty of people do it anyway, probably because the vast majority of Americans who apply for UK visas are approved within 2 weeks. Still a risk, though- only you can decide if you're comfortable taking it.
Also, you should keep in mind to build in the extra time for a biometrics appointment as well when you're trying to figure out approximate timelines.