Style is the broadest category of rules for writing letters. Style is quite individual but there are common phrases and expressions that are acceptable to include in a given type of letter and others that are not.
Needless to say slang, vulgar words and colloquials are to be omitted from formal letters. If you include such profanities in a formal letter, nobody will think that you are cool and your letter might even not have the chance to be read in its entirety. This does not mean that in personal letters you are obliged to include all the crazy talk you hear on the street but the style of personal letters is not so official.
Also, showing one's emotions in a too explicit way is not recommendable for formal letters. If you are angry at the other party, you can put it in harsh but polite words, rather than resort to the word style of a soap opera.
Another basic rule regarding style is to be as concise as possible. Generally letters are one page (12pt. or 14pt. font size, single or double spaced, 350 to 450 words altogether) and you'd better try to fit into it because many people (especially managers) simply don't read longer letters. If you have so much to say, use attachments. For instance, if you are reporting the financial results of a company, you can put only one or two really important figures in the letter itself and all other data should go in attached documents.
Although not everybody is a Hemingway, writing clearly is certainly an advantage. Always take into account who will read your letter – there is a difference in the way an official and a housewife will understand the same text (for instance an invitation to a community event), so if necessary, write two different letters for the same event but make sure that your intended audience will be able to comprehend your ideas.
A rule that applies to all types of letters but is especially important for formal ones is that you need to explain the purpose of your letter. This is done in the first paragraph of your letter and even you can start with it – “I am writing in response to your advertisement ..... ” , “After considering your offer in detail ...... ”. The words you use might vary but always include the purpose of your letter.
If you are sending the letter via e-mail, you may include the purpose in the Subject line (i.e. “Application for a Project Manager”) and then in the later itself clarify that you have seen a job advert in XYZ magazine/newspaper/site and you are applying for the position of a Project Manager.
Another rule for formal letters is that no short forms should be included. For instance, it is OK to write “I'm” or “don't” in a personal letter but for formal letters you need to write it in full – i.e. “I am”, “do not”. However, it is different with abbreviations. There are many widely used abbreviations, like: asap (as soon as possible) or cc (carbon copy), as well as industry-specific abbreviations (i.e. ERP – Enterprise Resource Planning) that are OK to use in formal letters.
If you work for an organization that has special codes for communication, chances are that there are thick books explaining what you can and what you can't write in a letter, so in this case your first task will be to check for these codes and follow them. Many organizations have standard forms for different letters and the worst is that these forms may have not much in common with the generally acceptable rules but since you are working for that particular organization, you need to follow the requirements.