You can't make changes in a document, workbook, or presentation you open from a shared location if someone else is already working on the file in their desktop version of Office. You can view the last saved version, but you can't edit the file until the other person closes it. This prevents two or more people from making conflicting changes in the file, such as commenting on text that the other person has deleted.
If you need to make changes in the file right away, you can use File > Save As to create a new copy of the file, and make your changes in your copy. You'll then need to reconcile your changes with those made by others in their copies.
More than one person can work on a shared file at once if everyone opens the file in one of the free Office Online apps, which instantly merge changes by all users in real time. Learn more about Office Online.