How are abbreviations determined in Chinese?
In whatever way that makes it convenient. There are probably endless different techniques used if one bothers looking for examples.

The situation is analogous to acronyms in Western languages. If you read that wiki article you'll find a huge list of examples and techniques used. Sometimes it's taking the first letters of words (North Atlantic Treaty Organization). Or the first few letters (Geheime Staatspolizei). Sometimes even numbers are used (K9, 3M). Sometimes it's whatever the creators think is cool (GNU).

Back to your examples:


  中华人民共和国人力资源和社会保障部


The 中华人民共和国 is highly redundant, so remove.


  人力资源和社会保障部


This is actually 4 words, 人力资源, 社会保障, 部. Words like 和 are redundant so remove. Take the first character of each word and voila:


  人社部


With 非典型肺炎, it's a bit unusual. There are two words here, but the 非 modifies 典型 so you can't remove it without changing its meaning. So the best you can do using common techniques is "非典肺". From there it's easy to simply drop the 肺.