And what are the conditions for resonance to take place?
Resonance ususally refers to the ability to draw more than one Lewis structure for a given connectivity of a molecule. It involves the sharing of multiple bonds in different ways within the framework. In the case of H3C-NH2, you have filled valence of C and N and all of the H-es, all with single bonds. The only way to draw any kind of resonance structure for this molecule would be to include some double-bonding from the lone pair of the Nitrogen to the Carbon, but this would give you pentavalent C, which is a no-no in Lewis Structures.
And what about CH3NO2?
For H3C-NO2, there is resonance in the -NO2 group, but you can't make C pentavalent. On the N, there is a formal charge of +1 and a formal charge of -1 on one of the oxygens.
For the picture that you show: H2CCHNO2, there are more resonance structures possible, but one of these will not be particularly important.
e.g. H2C-CH=NO2 [Each N-O bond is a single bond]
This Lewis Structure has +1 formal charges on the end Carbon, and the Nitrogen, and -1 formal charge on each of the oxygens. Separation of many, many charges like this is something that is difficult to do -- i.e. you would need to do work to separate the many charges, so chemists would say that this is a high-energy isomer, and does not contribute much to the true picture of what the real molecule looks like. For example, the charge density on the end carbon is probably pretty close to what you would expect for a neutral carbon, and the terminal C-C bond is probably closer to what you would expect for a double bond, than a single bond as drawn above.
So I can always assume that whenever a resonance structure has a pentavalent carbon, it doesn't exist?
Octet or less only (four electron pairs as bonds/lone pairs) for elements in the first complete row (BCNOF). Five bonds (pairs of electrons) are out for these elements, including Carbon.
Separate names with a comma.