It is the same as if you were to tell your husband or wife that you are leaving them in 3 months. You could reasonably expect 3 months of pure hell between the present moment and your departure date. You could also reasonably expect that if they really like you, they will attempt to convince you to change your mind, and your will to move on would be broken long before the three months had passed, but the general trust between you and your co-workers would also be broken.
Reasonably, they might just decide to hasten your departure so they don't have to look at you again. To reuse the marriage analogy, tell your wife or husband you are leaving and then drag it out 3 months, you might find yourself in an early grave, which in this case the analogy is "fired".
Best bet is to give 2 weeks notice when you hit that point.
Also, what if you change your mind and decide you aren't leaving after all? Will they let you stay?