If you want peace of mind, you could apply for a visitor visa in advance of travel. That way, it would be extremely unlikely you would be turned away at the border. But it's usually not necessary for US visitors to do this.
As a general rule of thumb, the longer you wish to stay in the UK, the more ties to the US you must demonstrate. Someone proposing to visit 2 weeks will likely encounter less questions at the border than someone wishing to stay 5 months. If the IO is satisfied you aren't an overstay risk and will leave the UK at the end of your visit, you'll get a visa at the border. It can be up to 6 months (and usually is for most people), but is at the discretion of the IO. You may be asked for evidence of finances, UK accomodation, travel/medical insurance, plans while visiting, and your ties to the US. So long as you can demonstrate such things, you'll likely be fine.