2 Hours and 50gp for each level of the spell.
The feature you are referring to is the Eldritch Invocation Book of Ancient Secrets (PHB, pg. 110), which states:
Prerequisite: Pact of the Tome feature
You can now inscribe magical rituals in your Book of Shadows. [...]
On your adventures, you can add other ritual spells to your Book of Shadows. When you find such a spell, you can add it to the book if the spell’s level is equal to or less than half your warlock level (rounded up) and if you can spare the time to transcribe the spell. For each level of the spell, the transcription process takes 2 hours and costs 50 gp for the rare inks needed to inscribe it.
You don't automatically receive this feature by selecting the Pact of the Tome, it must be chosen as one of your Eldritch Invocation options:
At 2nd level, you gain two eldritch invocations of your choice. Your invocation options are detailed at the end of the class description. When you gain certain warlock levels, you gain additional invocations of your choice, as shown in the Invocations Known column of the Warlock table.
Additionally, when you gain a level in this class, you can choose one of the invocations you know and replace it with another invocation that you could learn at that level.
So when you select Pact of the Tome at 3rd level, you can replace one of the invocations you learned at 2nd level with Book of Ancient Secrets.