The "2.4G" and "5G" numbers in Wi-Fi are radio frequency bands. 2.4G is short for the 2.4GHz band, and 5G is short for the 5GHz band (roughly 5.1 to 5.8 GHz, with some gaps in between depending on the country and regulator agency).
It is better to use the 2.4 GHz wireless band if you are going to connect over a larger distance (but unlike 5ghz, it's more likely to have network traffic). The 5 GHz band offers higher bandwidth for faster downloading, uploading and streaming videos online, but works best over shorter distances without many obstructions such as walls, etc.
In a nutshell, the 2.4GHz band gives you longer range, whereas the 5GHz band offers more channels that are less likely to be polluted with interference.
By default, a router should have 2.4GHz of Wifi Connection. If a router has a 5Ghz connection, just simply enable it thru the interface of the router and have your devices connected on the network name configured for the 5GHz WiFi.