I recently got a project to design logo design, stationery, website, brand identity for a startup company. I want to seek answers from a professional brand designer: is it compulsory to include a legal document at the final package to the customer?
If yes, if I want to publish online the works I did, should I include a license for usage (or is there a better term sounds like the client has a full right) or a copyright transfer document?
If I have given out the copyright transfer document to the client, will I still have the right to publish it online as the portfolio?
No, the client should not receive a legal document with the final package. That should come before the job, in the contract, or even the quote.
Legal rules are an absolutely crucial part of any professional agreement and should be clearly communicated upfront, not afterwards.
It is a very good practice to have a fixed set of Terms and Conditions that, by default, allow you to retain rights to publish the work as part of your portfolio. Even in those cases that you sold off the full copyright (which is a non-default situation you should charge for additionally by a decent margin, by the way), you should have a clause that retains you the display rights.
Include these Terms and Conditions with all your quotes and contracts, and reiterate in the contract text that your clients agree to them fully. This is important to legally protect you form your client (and vice versa) in case the relationship goes sour.
By default, my clients do not receive full copyright, just a license to use my work as-is. This means they cannot alter the work (or have it altered by others) to their own insights. I have seen clients drastically alter the colours of a logo I made for them after I delivered the logo. Those are cases you want to avoid at all times.
If you do choose to sell off the full copyrights to the design, it might be wise to spell that out in the contract text.
This is far from all you should arrange for in a good set of T&C. Lucian raises a couple good points in their answer, and there’s even more things. My own T&C are two full A4 pages of close-set 6-point text, amounting to seventeen articles with sub-articles.
Once you have an outline of your T&C, have a legal advisor check them for you so you know you are allowed to bind your customers by them.
So, I’m too late?
That’s all good and well, but doesn’t help your current situation. For that, I would draw up those terms and conditions, or at least an abridged version—just make sure with a legal advisor that they are in fact legal. Then, show those to your client, explaining in short what they contain and why you are asking them to sign the document. It’s very much possible that, under your jurisdiction, they need to sign a document like that to have the copyrights transferred to them. Most copyright laws protect the creator by default even if they sold their work.
Disclaimer: I am not a lawyer, nor do I aspire to be. Nothing in this answer shall be considered legal advice and no attorney-client relationship has been established. If you actually have legal problems, contact a lawyer.