Part of grappling is that both creatures become restrained. Part of restrained is that you lose and cannot gain flying. So with the kraken, if you enchant it with eagle wings while it's grappling, it will not gain the flying trait until after the grapple ends. If it is enchanted while not grappling, it will lose the flying trait whenever it initiates a grapple until the grapple ends.
With the Leviathan, however, he doesn't grapple nor cause himself to become restrained in any other way. So, if you put eagle wings on him, you just have a flying Leviathan and he still restrains enemy creatures in aquatic terrain.