There are 6 total chapters and each one has it's own memory to be unlocked, so there are 6 total memories to unlock.
You will experience a portion of the memory for the chapter for each time you fill the top left meter. To fill the meter you need to collect flowers that are scattered throughout the levels. As you collect the flowers the meter increases. To unlock a complete memory you will need to fill the meter 4 times, therefore unlocking the 4 portions of the memory for that chapter.
Do not worry if you have completed the last level in a chapter and your memory has not been completed, as you can replay and of the levels and the flowers will reset and allow you to continue to collect them and fill the meter the last bit if you need.