In The Witcher, Geralt does not need to sleep when tired, but he must meditate in order to allocate accrued talents as well as for any creation of bombs, oils or potions. In order to meditate, he must either light a campfire, a fireplace, or choose to meditate via conversation (typically with an innkeeper, but some other NPCs also offer this convenience).
The slider to the right of the hourglass is used to select how long (in number of hours) Geralt should meditate. Alternatively, one of the four "time of day" icons can be selected to meditate "until dawn", "until midday", "until dusk" or "until midnight".
Clicking on the hourglass in the centre initiates the period of meditation.
Meditation will typically restore your health and endurance, as well as cleanse you of toxicity and intoxication. If you meditate outdoors, one hour is enough to restore you to full vigor; meditating indoors will heal you much more slowly.
Note: If Geralt is brewing potions (or making other alchemical items), or allocating talents, the hour necessary for brewing potions or allocating the talents is automatically added to the number of hours remaining until the desired time of day. So be careful when trying to make a specific appointment.
Unlike the original game, Geralt can meditate anywhere as long as there are no enemies about. However, he must enter meditation mode to drink potions.
In the Witcher 3: Wild Hunt, Geralt can meditate anywhere, as long as he is outside of combat. To meditate, hold TAB and then press the SPACE BAR. You could also just press the N key without going into the quick menu. He does not have to meditate to level up or create potions.