I know the first example is correct and I'm pretty sure the second is incorrect, but I wonder why. So, we can say "I saw an extremely angry dog", but not "I saw extremely an angry dog." When do we put the adverb before/after the article?
In the first example, exactly modifies the adverbial phrase "the right time." It is, thusly, an adverb modifying another adverb, which is correct. In the second example, "the right time is the object of a preposition and must be modified by the adjective "exact" rather than the adverb "exactly."