Titanium is a metal, which like aluminum, has a very high strength-to-weight ratio. It also has a very high melting point. It is also a fairly commonly occurring element on earth (it is the seventh most common metal) and is found combined with other elements in nature. Several minerals and most igneous rocks contain a bit of titanium, but only a few minerals are commercially viable to extract titanium from. The processes to extract titanium from its ores are laborious and costly.
Titanium is more dense than aluminum, but is twice as strong. It is also fairly hard. Therefore, some manufacturers, such as Smith & Wesson and Barrett, make some firearm parts out of titanium.
A Smith & Wesson 342PD with a titanium cylinder
While titanium is hard, it is not as hard as some grades of steel, therefore it isn't normally used for parts like the barrel and bolt, which experience large forces. Machining it is also a tricky business, as it needs good tools and adequate cooling when machining, otherwise the metal turns soft. Welding it is also expensive as it easily combines with gases like oxygen, hydrogen and nitrogen when heated, therefore it must be welded in an inert gas atmosphere. According to Ben Rich, one of the engineers behind the SR-71 Blackbird airplane, which was made of titanium, chlorine also reacts with titanium when heated and they found that they had to use distilled water when washing spot welds, otherwise the welds would fail in a few weeks. Also, they had to throw out entire sets of wrenches away because they were plated with cadmium and found that these were contaminating the titanium and causing structural failures later.
All this means that titanium parts are pretty expensive to make. For instance, NEMO arms made an AR-10 model with several parts made of titanium: upper and lower receivers, muzzle brake, handguard, buffer tube and gas block. Total cost of the firearm: $100,000. And your humble editor wonders if the person that plans to buy this will ever fire it.
Most manufacturers generally only use titanium for a few components, such as revolver cylinders, frame components, pins, bipods, muzzle brakes etc.