I also get this issue on my Samsung S4, I tried the cache partition suggestion above and it didn't work. Also went into safe mode, tried to get into settings that way and eventually did a master reset, which hasn't resolved the issue.
Welcome to Android Central! You're still getting the "Settings has stopped" error message in Safe Mode? That would suggest a problem with the firmware. You could try reinstalling the firmware using Samsung Kies or Smart Switch (or manually with Odin: http://forums.androidcentral.com/am...w-flash-stock-rom-via-odin-new-interface.html)