Main memory is the internal storage area in a computer that temporarily stores data and programs. It includes RAM and ROM and allows for quick access of data by the CPU. Secondary memory provides long-term storage of data and programs not currently in use, such as on hard disks, CDs, DVDs, and USB drives. Computer memory is measured in bits, bytes, kilobytes, megabytes, gigabytes, and terabytes, with each unit being a multiple of the previous unit by a factor of 1024.