Perhaps you copy and pasted some code with a different line length than your other code. Or you join a project where the other have sinned against all the gods with their heretical indentation spacing. Tabs?!
PyCharm makes it easy to set code styles in wildly flexible ways (project
vs. IDE, EditorConfig files, inline markers to suppress, etc.)
But PyCharm makes it even easier to apply those code styles with the
Reformat Code action.