You have an entry clearance but have not been able to use it until it has only two months left to expiry. Assuming that you have the full 6 months of unspent leave, you have two options...
First option: you can apply for a variation. This is done upon arrival under Paragraph 31A of the rules, which says in part...
Where a person has arrived in the United Kingdom with leave to enter
or remain in the United Kingdom which is in force but was given to him
before his arrival, he may apply, on arrival at the port of entry in
the United Kingdom, for variation of that leave. An Immigration
Officer acting on behalf of the Secretary of State may vary the leave
at the port of entry but is not obliged to consider an application for
variation made at the port of entry.
You will need to be a bit careful how you frame it because if the IO sees a change of circumstances (like attending a wedding that already happened or such), he will get upset and then possible invoke Paragraph 30A (ii) to cancel your visa altogether. Also note that the rule says the IO doesn't have to do it if he doesn't want to, and if he doesn't want to issue a variation, there is nothing you can do at the port. Success lies very much in the realms of personal impact and articulation. If you are successful, there's no fee to pay.
Second option: Once you are landed, you can apply for an extension up to the amount of unspent leave you have to a maximum of 6 months. You can apply by post for about GBP 600 or in person for about GBP 1,000. Use the FLR(O) form. Bear in mind that extending a visitor visa is a non-suspensive application which means that if they take a long time you will automatically become an overstayer. Note that if you go for the in-person application and any little bit of your paperwork is out of order, or if your application has some complexity, they will keep the in-person fee and handle it as a postal application. People get upset when that happens, so be sure everything is spit-spot before you apply.
Nothing prevents you from trying both options. Carry a print-out of Paragraph 31A with you.