Stars appear as twinkling when we look at them from the earth’s surface. Light travels from the stars towards the earth while reaching the earth surface it has to pass from many layers of the atmosphere of different densities and temperature, as we know that temperature decreases by 6.5 degree Celsius, every kilometer we go up. So the light bends in many directions accordingly because light deviates from its original path whenever it enters the different medium of different density. Also the continuous movement of air in the atmosphere of earth causes the light to continuously deviate from its path.
This fast refraction of light in the atmosphere results in stars winking out. It appears to our eyes that stars are changing their position a little bit, which we call twinkling.
It has been noticed many times that the stars in the horizon appears more twinkling than the stars overhead this because the stars in the horizon has to pass through more atmospheric distance than the stars overhead. So light refracts (bends) more.
Stars will not appear twinkling if we look at them from space or from the other planet that has no atmosphere. Planets do not twinkle because it has a finite size and comparatively closer to earth and they are big enough that twinkling is not noticed, unless the air is extremely turbulent. It is because light travels from planets illuminate some receptor in the eye. Dim and bright light coming does not matter but the total amount of light that illuminates receptors matters.
While the stars are far away and point of light travels in a same way, same air movement in atmosphere it will bend the same. So amount of light reaching to eyes varies and it illuminates only one receptor that is why it appears twinkling.