What are you using to charge it?
If it's the 5W mini power adapter that typically comes with all iPhones, that's designed to charge relatively slowly. 3 hours doesn't sound that bad. If you want something faster, then a 12W power adapter designed for the iPad will result in faster charging, or a Mac computer with USB 3 ports. Also using a USB-C smart power adapter and Apple's USB-C to Lightning cable is supposed to the be the fastest way to charge an iPhone 8/8+/X. I've seen tests that show it's a little bit faster than using an iPad power adapter.
You'll need something with a higher output to charge faster. However, it's not purely linear. It has to slow down the charging current as it gets closer to 100% to protect the battery from overheating and possible fire risk. All lithium-ion batteries must be charged this way because otherwise it's going to reduce the longevity of the battery, and worst case can catch on fire.