For surface stains on your teeth baking soda is very effective since the baking soda toothpaste works as an abrasive and helps to scrub the surface stains off your teeth if you brush your teeth with the baking soda at least 2 times per day for a week.
For deeper or harder stains it's not as effective but still might work to remove the deeper stains from your teeth if you continue to brush your teeth with the baking soda paste for around a month.
If you're unable to get the deeper stains out then the best and most effective way of getting rid of deeper teeth stains is by seeing a dentist to get a good professional deep teeth cleaning.