How long is a piece of string?
Essentially it should not take too long (in my experience 20 minutes max from start to finish) although there are many, many factors that can affect the time taken to download and install the upgrade. Namely the reliability of your broadband connection, reliability of your router/firewall; reliability of the wireless connection (assuming you connect to your router wirelessly); downstream bandwidth supplied to your location by your ISP; the 'health' of your iMac; how much disk space for example? This is not an exhaustive list by any means.
If it's any help I would try the wired connection (ethernet) rather than wireless, I would log into your router's interface and double-check it's maintaining a good connection - if necessary reboot the router and try the upgrade again. Try and make sure there's only you using it at the time you do the upgrade.