John only punched Bill. means John punched Bill, but did not kick or slap him.
John punched only Bill. means John punched Bill, but didn't punch anyone else.
John punched Bill only. means the same as above because when modifying the last word of a sentence these modifiers can go before or after the last word.
Only John punched Bill. A lot of people were present, but the only one who punched Bill was John.
A prepositional phrase acting as an adjective must follow the noun it modifies.
The hammer on the workbench belonged to John. (Which hammer? The one on the workbench.)
The hammer belonged to John on the workbench (Why is John on the workbench? Seems dangerous.)Adverbs and prepositional phrases acting as adverbs can usually move around a sentence and retain their meaning.
John silently walked through the doorway.
John walked silently through the doorway.
Through the doorway, John walked silently.
Through the doorway, John silently walked.
John walked through the doorway silently.