Many modes have defined sophisticated indentation routines that are often specific to the context surrounding the cursor position. When this is the case, the mode will have an Indent On Return preference that can be turned on and off. When it is turned on, pressing Return will automatically indent the new line that is created.
If you don't want automatic indentation when pressing Return then turn this preference off via the menu item
Config > Mode Prefs > Preferences
Even if this preference is turned off, you can always indent the current line/selection using the Text > Indent menu command. In addition, pressing Command-Return will always indent the new line, while Control-Return will always insert a new line without indentation.