How long can I professionally wait to resign without subjecting myself
to 2 months of discourteous behavior?
2 weeks is the standard notice that companies accept in the U.S. & elsewhere. But if you want to be helpful, see if offering 3 weeks or 4 weeks would work.
But the reality is no matter how long your last weeks are, they will not be happy you are leaving. And you will not be happy staying. You will be gone at the end of that period and the hiring freeze issue exacerbates it.
Perhaps the best solution—if this is possible—is to give formal 2 weeks notice but then offer your services in a capacity that will keep you offsite but useful. Like perhaps you need to provide documentation to help others—or a future hire—complete your tasks. Maybe you can arrange a deal with your employer that after 2 weeks you would be gone, but for a period of 8 weeks after that you will remotely work on documentation & perhaps even field queries via e-mail or phone.
But like I said, they will simply not be happy you are leaving. And you will not be happy doing work in an environment like that for a full 10 weeks after you give notice. So best negotiate a balance that acknowledges the reality of your departure in a way that works best for you.