The sin has to be objectively serious matter.
St. Paul gives lists of sins that he says will ban people from the kingdom of heaven. Violations of the ten commandments are also examples.
However, stealing isn’t always grave matter. Stealing little things like candy bars, etc. isn’t grave matter. It is a sin, but it’s venial. When we steal stuff though, we are supposed to give it back, i.e. make restitution (even if it’s a little theft). If we take a little bit at a time over a long period with the intention of accumulating a lot, this would also be grave matter, or if we steal $5.00 from 10,000 people in order to get a big pile of money, that’s the same as one big theft. Hopefully that makes sense.
Sexual sins always constitute serious matter (grave matter). It says that in the document from the CDF entitled Persona humana (Declaration on Certain Questions Concerning Sexual Ethics) published in 1975. This is because sexuality is intimately bound up with our humanity and our person.
Hope this stuff helps.