Will IATA codes run out?
In short, the people sitting over the nose wheel use the ICAO codes, and the people in the back use the IATA codes.

The IATA is the International Airline Transport Association. The ICAO is the  International Civil Aviation Organization. While you are correct, the IATA does not have more than 17500 codes, their primary concern isn't creating codes for every airport including grass strips and private airfields. It is easy to think of IATA codes as being concerned essentially with identifiers that the passengers will need.

As far as ICAO is concerned, they contain a country identifier in their codes. They can even be more than 4 digits, as in the case of RU-2244 (Ukrainka Air Base). The vast majority are 4 digit or 5 digit, with the first 1 or 2 as the country code.

This allows ICAO to be available for every airport in the world. It is very common to refer to the IATA codes when flying locally, let's say within the USA, and refer to the ICAO if flying internationally.

I have a database structure of all airports in the world (or at least all known ones). This includes any grass/water/helipad/paved runways. 

There are a total of: 46,465 airport/airfields including those that have been closed. 

Source: http://ourairports.com/data/