Heathrow wait times change daily, and there's no way to predict your wait time. It depends on the terminal you arrive at and your line (EU and non-EU). I've breezed through immigration before in just 20 minutes, but I've also been behind a plane full of foreign students arriving in the UK for the first time, which held me up for well over an hour and a half. I went through about three weeks ago, and it was the average wait time. With the Olympics, it will gradually be getting busier, though.
I've flown into Heathrow and booked train travel in advance for that day, and have always left quite a bit of time in between. I just sit at St. Pancras for a few hours, get a coffee and read a book, before getting on my train, or switch to an earlier train. I'd recommend leaving at least an hour for getting through immigration, half an hour to get your bags and get to the Underground, an hour to get to the station in London (I go to Kings Cross, but an hour is average for most London stations), and an additional two hours just in case you get held up. If you're there really early, you can often get your tickets switched to an earlier train. I've never had a problem doing that before.