If you know there's no whitespace after the text, then `grep ">scaffold_3$"` is right.
Or rather use single quotes since `$` is special within double quotes, and if you want to lock the beginning to start of line too, then add `^` or use `grep -x`. So `grep '^>scaffold_3$'` or `grep -x '>scaffold_3'`
(`-x` is `--line-regexp`: force PATTERN to match only whole lines)
If you can have whitespace at the end of the line and want to ignore any, then
grep -e '>scaffold_3[[:space:]]*$'
would match any amount of optional whitespace between the string and the end of line. (And would also accept the match regardless of where in the line it starts.)
Note that if the file can have Windows-style CRLF line endings, then `>scaffold_3$` will _not_ do, the CR at the end won't match the pattern.