If you want the dictionary definition, just double click on any word.

Immunity and impunity are almost synonyms, but they are not always interchangeable.

Immunity is a broad term relating to protection from or exemption from something, especially an obligation or penalty.

For example: In US law, a witness who has been granted immunity, but   refuses to offer testimony may be held in contempt of the court.

Impunity has a narrower definition that refers explicitly to exemption from punishment or freedom from the injurious consequences of an action.

For example: Today it seems that the Internet is a place where hackers can break into computers with relative impunity.