The protective layer that covers a cell's surface and acts as a barrier between the inside of a cell and the cell's environment.