The 'name' in the $name variable will be a String value, as explained in the linked documentation you can use that data-type's length property to determine how many characters are in the value.
(set: $name to "Jane Doe") your name is $name, which has (print: $name's length) characters (including the space)