This is because the nitrogen atom has three bonding pairs and one lone pair of electrons. The bonding pairs of electrons are arranged in a trigonal plane, and the lone pair of electrons is oriented away from the bonding pairs. This results in a trigonal pyramid shape.