Sigh. There are no easy answers, as my numerous edits would attest had you been with me whilst writing an answer.
Ultimately the form of such abbreviations, initializations, and acronyms are determined by common usage (whether it be informal or formal) and style guides (e.g., newspapers, journals, magazines, etc.), and one will almost always find an exception to any "prescribed rule".
Just look at these examples to see what I mean (from an American English perspective):
- exampli gratis is usually written e.g., (including the comma.)
- id est is almost always written i.e., (again, including the comma.)
- nota bene is usually written NB, but also often written N.B.
- et cetera is always written etc., unless one is being very informal, in which case etc is acceptable.
Units and time get no love either:
- ante meridian can be written in myriad manners: a, am, a.m., A, AM, A.M. and can often be written without an intervening space, e.g.: 12:00a, 12:00am and 12:00 a.m. are all seen.
- Foot or Feet is written ft sometimes with and without the period: I need a 12ft board. Or, I need a 12 ft. board.
- Each is often written with a period (but occasionally without): They were $5 ea., which was too much, in my opinion.
Acronyms can vary widely:
- The National Aeronautics and Space Administration is written NASA or N.A.S.A. The former is more common, but a style guide may enforce the latter.
- But United States of America is written USA and U.S.A. commonly; a style guide may dictate the latter.
- And some simply become regular words: sonar, radar, etc.
Not even people get respect all the time:
- Doctor will most often be written Dr., as in Dr. Franklin. (But don't be surprised to see Dr Franklin either.)
- Mister follows the same pattern: Mr. Franklin and Mr Franklin are both used, though the former is more common.
- When abbreviating the first name, it is common to use a period: B. Franklin, but sometimes B Franklin.
One thing is nearly universal, however: if the period is omitted, the letters are written without intervening spaces. It would be extremely rare to see e g, i e, N A S A, D r, a m, A S A P. If spaces are used, it is usually in conjunction with the period: A. M., e. g., i. e., A. S. A. P.
There is, unfortunately, no one rule that fits every case where a word or phrase is shortened; the only real option is to follow common usage, or the style guide if one is present.