Your laptop is running as intended. The base frequency for the i5-8250U is 1.6 GHz. Under load, the CPU will go up to the max turbo frequency of 3.4GHz. This is all done automatically by Windows and the CPU.
Intel CPUs has something called turbo boost that will increase the speed of the CPU if there is a demand for it and if the CPU's temperature is below a certain level (something that Intel sets). While the i5-8250u CPU can achieve up to a max speed of 3.4GHz (when only one core is used), that is only for a short period of time.
Reviews have stated that under a constant heavy load the sustained max speed is around 2.4GHz. The i5-8250u is a "u" model CPU. The "u" stands for ultra low voltage which means laptops with "u" model CPUs have small heatsinks since the CPUs are not designed to generate a lot of heat. One way to prevent the CPU from generating too much heat is by limiting the clockspeed.
If you want a laptop that can sustain higher max clockspeeds, then you need to look at "HQ" model CPUs which will have larger and heavier heatsinks to dissipate the heat.