I highly recommend that you plan out the best time to resign if you are in the situation that you have time to strategize. Finding a new opportunity that best fits you takes a plan. It can take more than 6 months to find a new position depending on a number of factors.
There are things that are helpful to think about before you hand in your letter of resignation. To begin the process know what the job market is like in your profession, have an updated resume, have time to beef up your LinkedIn engagement, start to attend networking events if you aren't already involved, start to let close friends and family know that you are looking for new opportunities, get involved in career groups especially on LinkedIn, and start to prep for interviews.
Be aware that it is harder to interview if you recently quit. Interviews are where you sell your abilities, skills, knowledge and experiences. You talk about the most recent experiences that you have had that correlate with what the company is looking for in a new candidate. You will be asked about your current role or why you left your last role. Sometimes that can be difficult to explain without complaining about the company, supervisor or co-workers. You really don't want to say negative things about your past or current employer during any interview. That is where things can become difficult to explain if you decided to leave without another position to go to.
There have been times when employees can not stay in their current position until they find a new position. It can be a very negative situation and the employee can feel harassed, bullied or it can have a negative impact on their health or mental state. So each situation is different and needs to be thought through if at all possible. But when there isn't any negative situations that is impacting your health or mental state and you have time to think it through, I suggest you come up with a plan.
As much as walking in and quitting might seem like a good idea at the time strategizing is always a better option.