When the starting pitcher doesn't pitch enough innings. they usually give the win to the next guy if he keeps the lead. However, they don't have to do so. It's a scorer's decision.
I'd like to know how often it happens that way though because it seems pretty rare.