This is the first of a series of papers devoted to the foundations of Algebraic Geometry in homotopical and higher categorical contexts. In this paper we investigate a notion of higher topos. For this, we use S-categories (i.e. simplicially enriched categories) as models for certain kind of $\infty$-categories, and we develop the notions of S-topologies, S-sites and stacks over them. We prove that for an S-site T, there is a model category of stacks over T, generalizing Joyal-Jardine structure on simplicial presheaves on a Grothendieck site. We also shows, as an analog of the relation between topologies and localizing subcategories of the categories of presheaves, that there is a bijection between S-topologies on an S-category T, and certain left exact Bousfield localizations of the model category of pre-stacks on T. Then we study the notion of model topos due to C. Rezk, and relate it to our model categories of stacks over S-sites. In the second part of the paper, we present a parallel theory where S-categories, S-topologies and S-sites are replaced by model categories, model topologies and model sites. We prove that Dwyer-Kan simplicial localization provides a canonical way to pass from the theory of stacks over model sites to the theory of stacks over S-sites. As an application, we propose a definition of \'etale K-theory of ring spectra. An appendix gives an alternative approach to the theory which uses Segal categories. We define Segal topologies, Segal sites, stacks over Segal sites and Segal topoi. The existence of internal Hom's in this context allows us to define the Segal category of geometric morphisms between Segal topoi. An application to the reconstuction of a space via its Segal category of stacks is given.