This is an interesting question and one that is undoubtedly a point of contention among many different people. In general, none of these characteristics you've asked about should affect sentencing. Everyone should get sentenced depending on their crimes, not what they look like or who they are.
With that being said, the criminal justice system does not always work perfectly. When it comes to social class, there are a couple different things at play. For one, your economic class greatly determines what kind of lawyer you can get. If you have an amazing lawyer, it's likely you will get off with a better sentence than if you have a terrible lawyer. Additionally, we have to remember that court cases are decided by juries most of the time. If you are of a high social class, this can play into biases the jury may have about what criminals can be. They may think, "oh, this is a rich person, there's no way they committed this crime!" In general, we can expect people of a lower social class to be sentenced harder than those of a higher social class, though this is not always the case.
In terms of gender, there has been plenty research done. Many studies find that sentencing is easier on women than it is on men. One study controlled for other factors like marriage and children and still found this to be the case.
Age is a little more complicated, with some differing opinions existing. In general, for adults, age is not a huge factor in sentencing, and people of different ages largely receive similar sentences. Obviously, people who are not adults are typically not tried as adults, which is something that can change their sentencing. Additionally, there are some people that say elderly people are given more lenient sentences. Ultimately, this is up to the judge, and if they feel badly sentencing an elderly person to spend the rest of their life in jail, they may be more lenient.
So, the takeaway is that this is a complicated issue! Any kind of victim characteristics have the potential to affect sentencing, but it really depends, as it shouldn't happen. We largely have to look to empirical research for answers. Research mainly states that class has a big effect, gender has an effect (men are sentenced harder), and age can vary on how much of an effect it has.