The term school and department are going to mean different things at different institutions. Generally speaking, the term school refers to a larger unit within a university than department and many schools will contain multiple departments. For example, Harvard University contains a School of Public Health (and other schools) which contains a Department of Epidemiology (and other departments).
That said, names are often not even used uniformly or consistently within universities. For example, at the same organizational level as the School of Public Health at Harvard is the Faculty of Arts and Sciences which runs both Harvard College and the Graduate School of Arts and Sciences. My current university uses the concept of an academic "unit". Many units are "schools" (e.g., the School of Public Health or the Information School) but others are not (e.g., the College of Arts of Sciences). There is also an organization within the university called the Graduate School which cuts across and oversees work in different units and schools.
Sometimes, smaller "schools" will not contain separate departments. Sometimes, a large department in a large school might be larger than entire schools elsewhere in the university! Sometimes, the terms might be used interchangeably. In many other cases, they won't. In some cases, one or both terms might not even be used at all!