Grade system is based on win streaks. You need to win three in a row to rank up, or lose three in a row to rank down. Breaking either streak resets you to 0. Only ranked matches against players of similar rank (so if you're A, only B+, A, and A+ players count; and if you're S+, only S, S+, and SS players count) will go towards your win or loss streak. Using the "Display Search Results" function and only playing relevant matches, it's somewhat easy to quickly rank up until you've reached a grade where you can't win against people.
You can't rank down lower than C, and until C+ you're able to rank up by playing against anyone. If you're at S grade or higher, you instead need a 5 win streak to rank up.