Licencing a piece of code is as simple as that: just state that the code is under the license, and you're done. Usually it's a good idea to add author information, too. The whole point of the exercise is that any other person can unambiguously know the origin of the code and the license (thus permissions granted) for its usage. There is no formal requirement.
Yet, for ease of use, it's customary to put into the source files at the header a short copyright notice (thus license name and author) and accompany the whole source code with a COPYRIGHT or LICENSE or NOTICE file which spells out the authorship and especially the license in detail. This standard form makes it easy on two accounts:
- each file lists at the top what license (type) it uses
- anybody can get the full info from a dedicated file with a (semi)standardized name.
These two things make quick assessment of whether I (as user) can use the code for my purpose instead of going through a whole repository and looking at each file separately.
No open-source license will (and can) require that any user has to inform the creator. Such a condition would fail the desert-island-test and because of that, such license would not be considered open-source. Most licenses will require though that the original creator is credited at least in the form that their copyright notice is retained.