The main difference between these two terms is that search engine optimization is simply a component of search engine marketing. SEM includes components of paid search, such as PPC and also SMM (social media marketing).
It is important to note that you should never use the terms SEO and SEM interchangeably, because although they work hand in hand, they are not the same term.