How to measure True Power (Not Apparent Power) consumption in Alternating Current using ESP8266-12F Microcontroller?
I am facing problem in the measuring the Power factor of the appliance
  using ESP Microcontroller.


Trying to measure the power factor seems easy but in reality it's a tortuous path and I'll cut to the chase - don't bother because you'll be dissapointed. The only way you can reliably measure power factor is calculate apparent power, calculate real power and take the ratio.

For relatively pure sine waves you could use zero crossing detectors and calculate phase angle and take the cosine but this is not practical in a real-world situation. Harmonic distortion of the current waveform is such that there is no reliable method. Consider the current taken by a household appliance that uses a bridge rectifier and smoothing capacitor: -



As you can see the current is not sinusoidal but pulsing in nature and trying to establish phase angles from the above is a waste of time.

My answer here goes into greater detail about why zero-crossing is so problematic.

Ditto this answer.

To measure true power you mutiply the voltage waveform and the current waveform and take the average: -