They have 2 before the catalytic converters and 2 after the catalytic converters for a total of 4. Depends on the year of the truck. I know from 2002 and on they all have 4 O2 sensors. The 2 before the CATs monitor air/fuel ratio and effect gas mileage (So if you are getting bad gas mileage without a check engine light and decide to change O2 sensors, those are the ones to change). The ones after the CATs just monitor the catalytic converter efficiency and have no impact on fuel efficiency.
They say they have a life of 100,000 miles. Mine lasted 4.5 years of every day stop and go traffic and a lot of idling.
I replaced mine w/ the battery disconnected (negative battery cable). As far as removing them and putting new ones in there, I changed them through the fenders (turned wheels all the way to 1 side and squeezed my arm/hand in there w/ a wrench lol). The passenger side on my 3.0 was easy. The driver side was a lot harder because everything was in the way.
You may want to clean your mass air flow sensor, especially if your running an oil wetted gauze type filter (K&N). Pick up a can of CRC MAFS cleaner or electrical contact cleaner and a security torx T-20 (I believe) bit. Unplug the wires, take it out of the housing (make sure it isn't hot), spray it a few times (not really up close with a lot of pressure, you don't want to damage the wires), let it dry for a couple of minutes, put it back in, tighten it down, connect the plug and there ya go, clean MAFS.