Cells do mitosis when they are going to make an exact copy of themselves for asexual reproduction, growth, or tissue repair. DNA replication occurs once, followed by a single division. The parent and daughter cells are both diploid, which means they have a double set of chromosomes.
Cells do meiosis in order to produce gametes (eggs and sperm) for sexual reproduction. DNA replication occurs once, followed by two divisions. The parent cell is diploid, but the daughter cells are haploid, which means they have half the number of chromosomes as their parent cells.