Ellie's pistol is the handgun Joel hands her in Pittsburgh, taken from a dead hunter after the plaza fight, with the warning that it is for emergencies only. You control it yourself when you play as Ellie in Lakeside Resort, and she carries it through Left Behind.
Ellie uses it to cover Joel in the climax of the Pittsburgh chapter, saves herself and Henry from infected in the sewers, and keeps it at the University. In Left Behind she uses it against hostile survivors in the Colorado mall while she searches for medical supplies.
Ammo is scarce in Ellie's sections. Use the pistol to deal with whatever your switchblade and thrown bricks can't, and lean on stealth everywhere else.
9mm pistol
The 9mm pistol is Joel's first gun in The Last of Us Part I, picked up from his and Tess's hideout in The Quarantine Zone before they go after Robert. It fires fast, has the most ammo around and stays useful all game as a cheap backup to your heavier guns.
El Diablo
El Diablo is a scoped, high-caliber revolver and one of the strongest guns in the game, able to drop a bloater in two shots once upgraded. You find it in Tommy's Dam, on a body by the first abandoned car before the hydroelectric plant.
Revolver
The revolver hits harder than the 9mm but fires slower, and it is the pistol Joel draws in scripted scenes. You pick it up in The Outskirts from a dead soldier in downtown Boston, next to his field ops log.
Shorty
The Shorty is a one-handed sawed-off shotgun that sits in your pistol slot. You find it in the Pittsburgh sewers during The Suburbs, on a bench to the left just after you set off the first sound trap.