As Sound waves propogate in all directions, all waves from the source does not necessarily reach the listener.
Many such waves which do not travel directly to the listener hits the walls and gets reflected back and forth which eventually reaches the listener; in which the number of reflection depends on the distance between the source and listener.
Acoustic Panels placed in a room absorb the reflected indirect waves from the source of the sound;
Which is done mainly to enhance sound quality and at times for sound proofing Enough of that.
Assuming that you are talking about placing ac. foams around a cubical room,The best places to place them would be,Corners of the room;Vertices, which are to be covered with base traps( ac. foams which suck in lower frequencies and are usually thicker.)Edges, vertical edges can be covered by arching a piece of ac. foam panel so that a little air gap would be left on back side, which is done to increase efficiency of absorption.
Acoustic panels should also be placed in the lateral walls of the room.
A good cost effective way to do this would be to place ac. foams in an alternative arrangment like checkerd flags in one wall( A?),
And the wall oppostie to that( B?) should have the checkerd flag arrangement too but with a displaced step for the whole arrangement with respect to A.
i.e If Wall A has a foam piece then its parallel opposite side on Wall B can be left as it is without an ac. foam,
While, if Wall A is left as it is then its opposite side on Wall B should be mounted with an ac. foam.
If it's for sound proofing, then the best option is to get thick ac. foams and cover up all the air gaps and spaces which allows sound to go to the next confinement.
Anyway, you should probably consult an experienced acoustics professional, before trying to put up acoustic foam as the numbers, position, exact placement and other factors really matter.
If maybe it's for some indie recording, home theater setup, experimentation etc. go for the corners and some parts of the lateral walls and you wouldbe fine, I guess.
There are a variety of ways to find out if your positioning of the foams are just right, like the clapping technique. *more detailed information online*