Welcome to the forum!
As a US citizen, you have two options in regards to a visa for visiting the UK.
1. You apply for a visitor visa in advance of your travel.
2. You book your flight, show up at the UK border, and after a very short landing interview (about 5 minutes), you get a visa stamp that permits you entry.
For the majority of Americans visiting the UK, it's the second option. When you land, the immigration officer (IO) will ask you questions like:
How long are you staying?
Where are you staying?
What is the purpose of your trip?
How will you financially support yourself during your trip?
What do you do back in the US?
If the IO does not believe you to be a risk of violating the visitor visa terms, s/he will give you a stamp in your passport that permits you entry. This stamp is essentially your visitor visa (but unlike applying for one in advance, you get it issued at the border upon arrival). The IO can stamp you in for a maximum of 6 months, but has the ability to stamp you in for less than that. (ex. 3 months, 1 month, the exact duration of your trip according to your flight tickets, etc)
You can apply for a visa in advance of travel if you wish; however, this is usually for people who have previously refused visas, have been bounced, and so on. But if you are concerned about getting the visa stamp at the border, you can apply in advance for your peace of mind.
As a general rule of thumb, the longer you wish to stay in the UK, the more ties you must show to the US. The IO must have sufficient evidence that you will return to the US after a long UK visit, especially when there's a UK significant other involved.