Why cant I unscrew the bolt from my top cap? I have been trying to unscrew my top cap bolt to change the stem. I have been doing the unscrewing motion for more than 5 minutes and the bolt doesn't seem to come off. 

Like I keep turning the key to the anti clockwise direction and the bolt keeps spinning and doesn't come off

Is it really stuck like that? Any solutions?
Presuming a metal steerer (as opposed to something going wrong with a carbon compression plug), the main dynamic I've seen is the bolt seized to the central threaded piece of the star nut due to no lubrication , which then causes it to break free from the outer toothed part and spin freely when reefed on to try and turn it.

If you're lucky you may be able to get it by twisting the wrench sideways to try and get some friction between the toothed bit of the star nut and threaded bit. This is unlikely to work if the threads are really seized though. You may try hitting it with penetrating oil first, either blasted through the stem crack or the underside of the fork, but it probably won't help enough to overcome how it's also going to add lubricant where you want friction.

I fixed one once by pounding the star nut with a punch from the underside of the crown until it didn't hold anymore and came out. Putting reverse load on star nuts can scar up steerers, especially  aluminum ones, so if you want a gentler approach, then dissecting the top cap with a dremel cut off wheel and then working or cutting the star nut out once you have access to it also works.