Major open source licenses like the Apache or GPL have instructions on exactly how to put a comment at the top of each one of your source files. If you follow those instructions, you should be good. And yes, generally that means choosing a license, and adding a header as you showed at the top of every one of your source files. Please try to pick a license you will want to keep (understand the difference between Apache and GPL) and license all the files for your project under the same license.
The other thing you might want is a contributor's agreement. Contributors sign it to state that they are not adding any copyrighted, patented, or trademarked contributions to your code, or that if anything is copyrightable, patentable, or trademarkable, it falls under the license for the project. Consider a clause that states your intent in licensing and allows you to change the license to another one with the same intent at any time, or if the current license is proven difficult to enforce in court.
I am not a lawyer. These are just observations and suggestions, not legal advice.