I have a rule of thumb for job hopping - If it’s your Nth job in your career you can job hop after N years at that job.
In your first year you can hop after a year. Then you stay for 2 years at the next , 3 years at the next and so on.
Staying at a shitty job at the beginning of your career is a terrible idea. But only having short stints in the later half of your career is also a bad idea.