What time period was the book written in? I know it was published in 1961 but in what time setting does the book take place?
It's good that you have already noted the difference between the book's publication year and its time setting. You are right that the book was published in 1961, and it earned the Pulitzer Prize for fiction that year.
But in 1961, when To Kill a Mockingbird was published, it was a period piece. Very early in the book Scout, the narrrator, tells us that the book opens in 1935. Since the events of the book take place over a few years, we can say that it is set in the mid- to late 1930s.
The time period is significant for a number of reasons. The United States was in the midst of the Great Depression in the 1930s, and we see much evidence of poverty in the novel--in the Cunninghams, in the Ewells, and even to a lesser extent in the Finches. Scout asks Atticus if they are poor, and he answers "We are indeed," but he qualifies by saying that the Crash (the start of the Depression) hit rural families like the Cunninghams the hardest.
The time setting of the book also explains the bitter and disturbing racism depicted in the book. Though racism continues, Civil Rights legislation (which went into effect even after the book's publication) prevents the kind of rampant abuse of the justice system we see in the book. The 1930s setting further explains the segregation that results in Calpurnia's being criticized for taking the Finch children to her church and the way that Dolphus Raymond is spurned by the society for living with a black woman and having mixed race children.
Atticus tells his children that the very fact that the jury stays out for two hours (instead of returning immediately with a guilty verdict) shows that changes are taking place. But there was far to go. Many would say there is still far to go until we achieve a society with full justice, but we have come a long ways since the time period of this great novel.