If you mean 4m x 4m then you could grow a dozen pumpkins in box, but I presume you mean a 4ft x 4ft box, in which case 1-4 pumpkin plants can be planted in box, with 1-2 being easier to manage.
Pumpkins need lots of food and water, so start off with pure rich compost. Every week or two feed with liquid compost tea or organic fertiliser. Depending on the variety, a couple of pumpkin plants in a 4' x 4' above ground container will trail over the sides and could take up to more than 2000 sq ft each unless you pinch out the growing tips.
In hot weather pumpkins might need water each day as they grow so fast and their large leaves transpire readily.