Online programming, often called "online editing", means to make changes to a live, running system. It is obviously more risky, since if you make a mistake, you can cause equipment damage or even safety problems. It has the advantages of allowing changes without stopping a process as well as immediate feedback...you will know right away if your changes worked as intended.
Offline programming means writing the code on a PC that will be downloaded to the PLC at a later time. Offline programming is used to develop new programs for both new and existing machines. It is also used to edit existing programs without having to be at the machine.
Some PLCs will allow an offline program to be downloaded without halting the one that is running, but most will require the PLC to be stopped first. It is generally safer because the machine will be stopped and all affected personnel will usually be prepared for the possibility of issues when testing out the new code. It has the disadvantage of requiring machine downtime for implementation (in most cases). It also may be more likely to have errors, since usually an offline program will contain more untested code and configuration changes than an online edit.