The origin of the phrase is thought to stem from the practice of employers giving their dismissed employees a written document, often on a single sheet of paper, stating the reason for their termination and sometimes including their final paycheck. This document was called "walking papers" because it allowed the employee to "walk out" of the job.
Therefore, when someone says they got their walking papers, it means they were let go from their position.