The difference between impunity and immunity is that :-
Impunity means exemption or freedom from punishment or from the injurious consequences of an action which is considered as a narrower definition.
But immunity means protection from or exemption from something like an obligation or penalty which is considered as a broad term.