The easy way
The most simple way to do this is to create a new field with the expression
"cat" > 20
This expression will evaluate to a boolean True/False which will be represented as an integer 1 or 0.
You can also create a virtual field, which will automatically return an updated value in case the values in
cat change (e.g. you edit the layer). Remember that the values of virtual fields will not be saved in the dataset and are only visible inside this QGIS project.
More than boolean
If you have more than a simple "greater than", you need to use
WHEN "cat" > 100 THEN 2
WHEN "cat" > 10 THEN 1