How to use TIMER 2 as simple counter in STM8S103F3?
After reading Reference Manual more I found we need to set UG bit TIM2_EGR to generate and update event so MCU will take the prescaler value for TIMER 4.

TIM2_EGR |= (1 &lt;&lt; TIM2_EGR_UG);


So, updated code will be:

#include "stm8s.h"

int main() {
  // Default clock is HSI/8 = 2MHz

  PB_DDR |= (1 &lt;&lt; PB5); // PB5 is now output
  PB_CR1 |= (1 &lt;&lt; PB5); // PB5 is now pushpull

  TIM2_PSCR = 0b00000111; //  Prescaler = 128
  TIM2_EGR |= (1 &lt;&lt; TIM2_EGR_UG); // Generate an update event so prescaler value will be taken into account.
  TIM2_CR1 |= (1 &lt;&lt; TIM2_CR1_CEN); // Enable TIM2

  while (1) {
    if ( ( ((uint16_t)TIM2_CNTRH &lt;&lt; 8) + (uint16_t)TIM2_CNTRL ) &gt;= 15625 ) {
      // Reset counter back to 0
      TIM2_CNTRH = 0;
      TIM2_CNTRL = 0;

      // Toggle LED.
      PB_ODR ^= (1 &lt;&lt; PB5);
    }
  }
}


Now the LED started to toggle in each second!!