A two weeks notice letter is a short written statement that you are resigning and that your employment ends fourteen days from now. It is the standard way to leave a job in the US, and it does two things at once: it starts the clock on your notice period, and it creates a dated record that HR can file.
It is not a legal document in most states. At-will employment means either side can end the relationship at any time, so two weeks is a professional convention rather than a requirement. That convention still matters. Notice is how your employer keeps a project from falling over, and it is a large part of what a former manager thinks of when a reference call comes in three years later.
A two weeks notice letter is a specific kind of resignation letter, one where the timing is the whole point. If you want a longer letter that also covers your reasons for leaving and what the job meant to you, use the resignation letter generator instead. Everything below applies to both.