In this paper we investigate the finite-time and fixed-time consensus problems of multiagent networks with pinning control and noise perturbation. In order to reach the finite-time and fixed-time consensus, several pinning protocols are proposed. Compared with the consensus protocols without pinning control, the proposed finite-time and fixed-time protocols need to control only a small fraction of agents, which is practical and has advantages from the physical viewpoint of energy consumption. More specifically, the deterministic and stochastic protocols include the graph $(p+1)$-Laplacian, a nonlinear generalization of the standard graph Laplacian. We show that, unlike the protocols with the standard (linear) graph Laplacian, those with the graph $(p+1)$-Laplacian solve the finite-time as well as the fixed-time consensus problems. By using the finite-time and fixed-time stability theory and the algebra graph theory, sufficient conditions are established to ensure the finite-time and fixed-time consensus. Finally, numerical simulations are presented to illustrate the correctness of the theoretical results.