As it seems to be possible to teleport people between two parts of the ship (e.g. TNG: Gambit, Part II), why the Transporter, instead of the Turbolift, isn't the primary mechanism to transport people to different parts of the starship?
Because it isn't necessary. Intraship transport is relegated to medical and security emergencies. There are a limited number of transporters available and such energy is more vital to other services on the ship such as shields or the warp engines.
Despite the relative abundance of energy in the Federation universe, it still costs energy to convert people into energy and restore them upon arrival. Since this energy comes from the warp engines and depletes dilithium it is unlikely such a use of energy would be conducive to good operational procedure except in emergencies.
The turbolift is a far more energy effective means of moving crew members, equipment and visitors around the ship using a fraction of the energy of the transporter. During an emergency without warp power, there would be NO means of getting around the ship quickly except for transporters which could be taken out by enemy fire, power outages, or other emergencies.
From a health and psychological perspective, walking is good for the crew, keeps them fit and healthy. Moving through the ship promotes good relationships and interactions between the crew.
Starfleet vessels are just too small to merit the expenditure of energy on site-to-site transporters when simple turbolifts are sufficient.
Star Trek production illustrator Doug Drexler, when discussing the next (next) generation of Starfleet vessels identified that the Enterprise-J would use transporters as the primary method of moving people around. He notes that this is due to the sheer size of the vessel:
"as a multi-generational vessel, that had large parks, entertainment zones, and entire universities on board. The ship is so large that turbolifts would be replaced with site to site transporters. [It] had one deflector, recognizably descended from the NX. I opted for spindly nacelle struts because I felt it suggested a technology beyond what we were familiar with. They are beyond transwarp. They can fold space, and they are exploring other galaxies besides the Milky Way."
Also, based on this conversation in the Star Trek pilot, it's pretty clear that although the technology has been ubiquitous for nearly a century, not everyone likes being transported.
DATA'S VOICE : But, sir, the transporter could have you on the Hood in a matter of seconds, Admiral.
Data and the admiral ENTER SCENE at the intersection. The admiral is very old with an almost transparent look.
ADMIRAL : Have you got some reason to want my atoms scattered all over space?
Dr Pulaski shows a similar concern in TNG: Unnatural Selection as does Reginald Barclay in TNG: Realm of Fear, etc. It's hardly fair to expect officers to simply lump it that they'll have to be transported dozens of times a day.
Out of universe, the aim was to preserve as much of the "look" of the original Star Trek while allowing for evolution of the technology rather than outright revolution.
There were also production considerations;
The fact that Gene Roddenberry liked the concept of having discussions in the turbolifts of the Galaxy-class Enterprise influenced the designers of the ship, who at first considered having an on-bridge transporter for TNG, to ultimately discard that idea. (Starlog issue #125, p. 46)
Originally, transporter beams only faced outwards, so you had to use a transporter room to beam out. Then they started pointing them inwards, but had issues with safety (such as materializing inside a bulkhead).
By the time we get to TNG, these technical issues have been overcome, but there is a large energy requirement for beaming. If the entire population of the Enterprise D (1000+) were transporting everywhere they went, it would consume a lot of energy. Furthermore, there likely are not enough transporter beam emitters facing inwards to satisfy the volume of transports that would be used in a a regular commute with-in the ship and recreation.
It is typically in emergency situations that you see people using site-to-site transports (such as to sick bay).
From the dubious Wikipedia
A possible explanation for this is put forward in the Star Trek: Deep Space Nine Technical Manual, where such site-to-site transports would probably use twice as much energy as would be required for transport to or from the transporter room itself
Site-to-site transporting costs twice as much energy as just going to the transporter room. Therefore, if you have to walk to the transporter room, you might as well take the turbolift to 10-Forward.
One important answer that was missed here is personnel. In every incarnation of Star Trek there is a Transporter Operator. Whatever the technological advancement, automated transport by the computer was a rarity (though it certainly did happen; nevertheless, often in "Emergency Transport" situations there was still an operator).
If we assume they weren't wasting the personnel on unnecessary transporter supervision, then the Transporter Operator performed some essential function in supervising the transport and making sure it was executed properly.
This, more than anything else, would make it prohibitive to use transporter technology for intraship transportation.
I suggest it's because as a general rule, transport while at warp is prohibited. As you would need to navigate the ship at any time - and whilst walking the corridors, have limited knowledge of whether you're at warp or not - it would likely be an established practice to just use the turbolifts.
STTNG S2 Ep 6 The Schizoid Man and STDS9 S2 Ep 15 Paradise being (possible) examples?
This theory supported by this line at Memory Alpha
"Except in cases of extreme emergency, protocols prohibited transporting objects while traveling at warp speed".
Another likely reason they didn't use the transporter for intraship transport is because of the risks involved. As mentioned on http://en.memory-alpha.org/wiki/Transporter#Transporter_accidents, There has been at least a dozen incidents with the transporters, some of which with lethal consequences, and that's just on the handful of ships we see in the shows and movies. Meanwhile, the turbolift (http://en.memory-alpha.org/wiki/Turbolift#Turbolift_incidents) has only had a handful of incidents, and none of them had deadly consequences.