The Periodic Table lists (i) the atomic symbol, (ii) the atomic number, #Z#, and (iii) the atomic mass with units of #g*mol^-1#. You will always be issued a copy of the Periodic Table in a chemistry or physics exam.
For nitrogen, #Z=7#, and the atomic mass is listed as #14.01*g*mol^-1#. Since elemental nitrogen is a diatomic element, (in fact ALL the elemental gases SAVE the inert gases are diatomic, i.e. #X_2#), the mass of gaseous nitrogen is #28.02*g*mol^-1#.
Note that you simply have to KNOW that it is #"dihydrogen, dioxygen, dinitrogen, difluorine, dichlorine etc"#. #H_2#, #N_2# etc. are the standard states of these elements under standard conditions. You would not be told this normally (certainly not if you are an undergrad!).