What is the appropriate amount of time to stay at a new job that you recognize immediately is not a good fit?

The quicker the exit the better. Explain in a professional manner why you feel you need to leave, and then leave. It might be uncomfortable. That’s life. It’s worse to stay longer than necessary, for you and the place of work.