You are always able to renew your license in person. You may renew your license by mail if your driver license doesn't expire in more than 60 days from the date you are renewing and you are under 70. You also must not have violated a promise to appear in court in the past two years, not have two consequence five year extensions in the mail and not have any driving probations. Additionally, you cannot have a driver's license from more than one state or jurisdiction to be able to apply by mail.
To renew your license, you will need a new Form DL 44 Driver's License Application at the very least. In some circumstances, you may need to retake the written test. Your renewal notice will inform you whether the written test is necessary. If you have to retake the written test, you only need to answer the first 18 out of 36 questions correctly.
You may renew your license online if you have a renewal notice in the mail with a renewal Identification Number, and if you have the same address and your Social Security Number on record at the DMV. You must also have a valid credit card.