Catalyzes the ATP-dependent biosynthesis of glutamine from glutamate and ammonia. ATP + L-glutamate + NH4(+) = ADP + H(+) + L-glutamine + phosphate Homooctamer and homotetramer. Belongs to the glutamine synthetase family.