Go to the USCIS web site and it will give you all the information. You need an I-129 for the TN and an I-539 if you need TD's. Read the instruction attachment carefully and it will tell you what to do. Check the processing times on their website and it will tell you how long.
You also need to make sure you send it to the correct processing center when doing it by mail. It's based on what state you are in.
You can also submit the I-129 via the internet and send the back up documentation separately.
If you submit this before your TN expires then you are good to continue working for up to 240 days or until it is approved.
Don't forget that if you leave the country, before it comes in, you will have to get a new one at the point of entry (POE) when you come back, and your mail in one is null and void.
Read all of the instructions first before asking more questions or you will get slammed by all of the other posters including me.