Note: This page is taken from n.wikia.com.(As written in the N in-game help)
Thanks to your sickeningly materialistic attitude, collecting this stuff makes you happy, and that helps you live a bit longer. (Translation: adds 2 seconds to your lifespan)Grabbing a piece of gold adds two extra seconds to the timer, which helps the player survive, and may increase the score. Some maps are full of gold, like 08-4: caseless edit, while some are so scarce in them that one may risk running out of time while attempting to complete them. It's important to keep in mind that it is possible to hide trap door switches under gold pieces, and over-greediness may cause some bad results.