One part of this question is answered very clearly in Tales of a Fourth Grade Nothing, but the other is not. The book clearly states where it is set, but it does not state when it is set.
The book explicitly states that the action is taking place in New York City. The first place we can see this is on p. 4. There, Peter is talking about himself and where he lives. He says,
I live at 25 West 68th Street. … it’s got one of the best elevators in New York City.
The location is further confirmed at the start of Chapter 4 (p. 29) when Peter says “We live near Central Park.” Thus, we can clearly see that the book is set in New York City.
However, Blume never clearly states the year in which the book’s events take place. We know that the book was published in 1972 and there is nothing in the book to imply that the book is set a long time before or after that date. There is nothing futuristic in the book to suggest that it is set in the future. At the same time, there is nothing that implies that it is set in the past. The Hatcher family watches TV and goes to the movies so it is clearly not set before WWII. In Chapter 7, Peter and his group read books about traffic congestion and pollution, which implies that the book was set in the late 1960s or early 1970s when these issues were becoming important to many Americans.
We know, then, that the book is set in New York City and we can assume that it is set very near in time to 1972.