How many magnesium tablets would you have to take to have a fatal overdose?

Lots. Babies have fatally overdosed on magnesium, but not adults with normal kidneys. I suppose enough magnesium could cause severe diarrhea and death might result from massive diarrhea and electrolyte depletion and dehydration over many days eventually. But someone would have to be intentionally wanting to do this.
A lot. No matter the size of the pill, because mg is not well absorbed the biggest symptom would be diarrhea. Renal failure patients would be in more danger because the kidneys remove excess mg. I suggest that you discuss this (and any other) fatal ideation with your physician and get help if you are suicidal.