A cipher is an algorithm for performing encryption or decryption—a series of well-defined steps that can be followed as a procedure. An example of a cipher is the Advanced Encryption Standard (AES).
A code is a system of symbols, letters, words, or signals that are used instead of ordinary words and numbers to send messages or store information. An example of a code is Morse code.