In published writing in English, there should normally be a space before units that are words or abbreviations:
Unlike in some cases in German, there is no space, however, if the unit is a symbol.
98.6° / 98.6°F
45° / 90° / 180° / 360°
The instances I've seen that deviate from this are often in contexts such as journalism, where usage may now often be dictated by the limits of HTML, so it seems to have become customary to just attach the unit to the numeral, in part because it's the easy way out. Particularly with large sums of money, or in sports, headline usage has become its own context, and the same abbreviations may now appear in running text, especially online.
The Guardian, for instance, uses a style like €200bn (billion), $2tn (trillion). US newspapers use capital letters: 10k (kilometers), 4K (thousand), $100M (million), $20B (billion), $2T (trillion).
The Chicago Manual is a good general source, but those writing in particular academic fields should use the style guide accepted as standard in their profession.