If the number of flights in the world exceed 2^24 how will ICAO allocate the address to the flights?
Addresses are assigned to suitable equipped aircraft, not to flights. The total of 16 777 214 available adresses is distributed in blocks that are assigned to individual states. Block size depends on the size of the states, e.g. the US and Russian Federation have block with 1048576 addresses, while e.g. Grenada or Mauritius only have blocks of 1024 addresses.

The allocation of addresses is decribed in ICAO Annex 10, Vol. III, Chapter 9. 

An extract of the relevant part can be found here.

As long as the addresses are just assigned to conventional Mode-S transponder equipped aircraft there should be sufficient free addresses. This could change if all airspace users would be assigned a unique address, e.g all drones participating in future UTM (urban or unmanned traffic management).