It could very well be a fan as others have said here. Fans are cheap and are cheaply made these days. They don't have greased bearings and are made with simple grease impregnated bushings. Eventually the bushings wear out or dry out causing the squealing as they don't spin as well as they used to.
What makes me inclined to think this too is the fact that the sound starts then it disappears only to appear later. A hard disk drive will also exhibit other issues such as poor performance, cause system lockups, freezes, and the worst part of data corruption and loss.
If it's the power supply fan, you need to replace the power supply. I recommend replacing the PS with the same rating or better. Never go below, otherwise, other components will fail or run unreliably due to lack of adequate power.
Other fans can easily be replaced. Go online to places such as New Egg
www.newegg.com for your parts. New Egg has an excellent return policy and excellent shipping for their parts. I've dealt with them for well over a decade if not longer with no problems at all.
The other place to check is Microcenter. (I forget their URL)
if it's a ready-made box, you may be in luck with the company replacement program if you are still under contract.