David is incorrect. With a flight to Europe, the recommended check in time is 2 hours - it is 3 hours to the States. I have never had it take 2 hours to get through immigration, but it could take over an hour.
Best case scenario, your flight is on time and the queues aren't too bad at immigration, so say through at 2.45.
It will take time to use left luggage unless you want to drag it round with you.
Wait for the Heathow Express then take the train and the underground to Westminster (Bakerloo then Jubilee lines) is say 75 minutes including buying tickets. So 4.15 there plus any time to drop your bag at Heathrow.
Another 75 minutes back to Heathrow. That's 5.45 without any stopping at Parliament. You need to be back at Heathrow by 6pm absolute latest. That gives you 15 minutes to view Parliament IF everything is running to time. Too risky. A taxi will be very expensive and may not be much quicker.
There are restoration works ongoing at the Queen Elizabeth Tower (Big Ben), so the Tower maybe covered in scaffolding at the time of your visit.