Since this is a very generic question, and I can't comment only post an answer I'll just try and help out here.
if strlen($description >= 16) {
// more then 16 characters
// We need to charge the user
} else {
// Not more then 16 characters, continue.
}
W3Schools: https://www.w3schools.com/php/func_string_strlen.asp
PHP Site: http://php.net/manual/en/function.strlen.php
As per the comment below. Here is a mockup just for demonstration. I'm not sure how all of your site is setup, so I can't exactly make it work copy&paste for you. I'm not sure entirely how WooCommerce is setup in terms of payment.
<?php
// If form is submitted
if (isset($_POST['description']) && !empty($_POST['description'])) {
// Form is submitted, check length
$description = trim($_POST['description']);
if strlen($description >= 16) {
// more then 16 characters
// We need to charge the user
} else {
// Not more then 16 characters, continue.
}
}
?>
<html>
... Your other code here ...
<form method='POST' action="$_SERVER['PHP_SELF']">
<input type='text' name='description' />
<input type='submit' />
</form>
</html>
Again, this isn't ready for copy & paste. I know people on this forum are very particular and judgemental so please beware it's a mockup. You will need to ensure the input is secure and safe etc. I'm not sure how to directly hook into woocommerce so I apologize if this is just a waste of your time.
It's my first legitimate answer, be nice.