Unfortunately, there is no hard and fast rule. First, different hooks have different compositions and coatings to prevent them from rusting. So, a stainless steel hook, or a hook coated with "duratin", will take longer to dissolve than a plain bronze hook. Basically, if the hook leaves little rust marks in your tackle box, it will probably dissolve in the fish's system much more quickly.
Furthermore, if the hook does any damage to the fish on it's way down then the fish will be much more vulnerable.
Whenever I gut hook one that I don't want to keep I try not to play it longer than I need to and I cut the line as close to the hook as I can and then release the little guy.
That's good. You do what you can to increase the chance of it surviving. However, I think the odds are stacked up against the little guy. That is why some states regulations call any trout caught with bait against your daily limit. If I'm trout fishing with bait, I keep fish that are deep hooked for dinner and release any fish hooked in the lip or any large/small fish. Once I deep-hook the amount I intended to eat immediately, I switch to lures.