You can get a chemical burn from toothpaste if you do not wash the toothpaste off your skin and mouth when done.
So make sure you wash off any leftover toothpaste that could be on your lips and mouth to prevent a toothpaste burn.
A toothpaste burn should heal on it's own within 1 to 2 weeks and sometimes sooner.
I've left toothpaste on my face before and forgot to wash the toothpaste off my skin and the toothpaste caused a burn near my mouth and on my lips.
Within a few days the toothpaste burn started healing and within 2 weeks the toothpaste burn was fully healed and no longer hurt.
A toothpaste burn will heal on it's own and should fully go away within a few weeks depending on how bad the toothpaste burn is.
When you use toothpaste make sure to wipe your face off with a wet wash rag to remove any toothpaste that can be left on your face.
There's not much you can do to speed up the healing of the toothpaste burn but you could apply some hydrogen peroxide to it and it will help the healing of the toothpaste burn.