How can I save this custom value in database and get in the cart page with the custom option ?
I think you should use,
catalog_product_type_prepare_full_options event because this event triggered just before the product with its custom options is converted to a quote item.
In this event you can get added product object
$product object by using,
$product = $observer->getEvent()->getProduct();
Now you can add your custom option like,
$infoOptions = array( 'label' => "YOUR_OPTION_LABEL", 'value' => "YOUR_OPTION_VALUE", );
you can update this option according your requirement,
Now just add this custom option like,
Add this custom option by