On opening the edit form, the object is retrieved for both users and displayed in their client. When they make changes to this object, these changes won't be visible to other users until the object is committed (by pressing the save button). If both users press the save button (almost) simultaneously, I think the second commit "wins" (will overwrite the changes made by the first commit).
There is no built-in support for record locking. There's something in the app store if you want to do record locking.