If you do use a period, it always goes after what is being abbreviatedabbreviated
Dr. (doctor, not to be confused with "drive")
St. (saint, not to be confused with "street")
Ph.D.
However, a period is not always used, especially in BrE, and seems to get dropped from time to time in AmE, for example in addresses.
In your first example, putting the period before the "C" would result in
John .C
since the period is usually not a word delimiter in written English, otherwise it would be
John C.Williams
which would be incorrect, however, there are times it might be formatted as
John C.J. Williams
for contiguous abbreviations.
The famous example which breaks the rules is
Formatting the abbreviation as
John.C
looks more programming-ish, "C" is a method for object "John".