Can you take the SAT after a gap year, or even just after you've finished 12th grade? Or do you have to take it while you're still in high school?
Yes, you can absolutely take the SAT after you're no longer in high school. If you're planning ahead of time to take a gap year, you might want to consider taking the SAT while you're in high school and then deferring admission to colleges, rather than waiting to take the SAT after high school, because the material will be fresher in your mind then. But you certainly don't HAVE to take the SAT while you're in high school.
More information about applying to colleges as a non-high schooler can be found in this article (under the section titled "I'm Going Back to College After a Year or More Off").