In NF3, N is surrounded by three F-atoms. N contains 5 valence electrons (7N 2,5). Its three electrons are used to form bond with three F - atoms, so one lone pair of electrons is present in this molecule on N-atom. It shows lp -bp repulsion which is more than bp-bp repulsion. So, its shape is pyramidal.
While in BF3, B is surround by three F- atoms. B contains three valence electrons (5B = 2,3) It does not have lone pair of electrons. So, its shape is trigonal planar.