What’s the best practice for placement of settings menu in a webapp or website?

I was wondering is there any reason behind placing "settings" alongside other menu items and placing it inside profile or some other menu? Can anyone tell me what's the difference?