How much time can you take off? Are you doing away rotations? How difficult was Step 1 for you? Any red flags on your application? What specialty are you applying for? Minimum should be one month. I think 5-6 weeks is the sweet spot personally.
If you studied for the shelf exams during M3 then you've already been prepping for Step 2 for the past year.
Unless you're trying to address major knowledge gaps, 2-3 weeks is sufficient. 4 weeks will have you hating life (even more). Anything beyond that is pointless self-torture.
Plan for 4-6 weeks (IR and DR is quite step 2 score driven). Take a diagnostic NBME at the beginning. If you score over 250, then 2-3 wks is fine, if less than 250 then 4-6 wks
I struggled majorly with Step 1 (took 12 weeks and still wasn't sure I'd pass) but found Step 2 to be much easier in comparison after having done all my rotations in M3 year. Averaged 70s for all the shelf, took 5 weeks for step 2 dedicated and scored mid-250s. I could've grinded more for 260+ but I decided that wasn't necessary for the specialty I was going for.