If you buy a game through digital, you will not have to do anything. Once the game becomes availible for PS4 on the PlayStation Store, it will be listed as $9.99 for you and you can purchase and download it. There is nothing more to it there.
However if you bought a retail copy of a game, you will need to do an extra step. Every select copy of PS3 games part of the program will come with an insert in the case. The insert includes a code to put on the PlayStation Network, which activates the $9.99 option when the PS4 version releases on the store. You can then purchased the game and download it.
However according to the details, you will need the PS3 disc to play the game. It’s stated that you need the disc to activate the game, both while downloading and playing. So you will need to keep the PS3 copy of the game in order to play the PS4 version. You simply put the PS3 disc into the PS4.
You can redeem the code as soon as you buy the game, then use a PS4 to purchase the upgraded game. The program begins unlisting titles on January 31st, so you better act fast!