One space or two after a sentence?

Back in middle school, I took a little computer class where we learned how to load files from a 5 1/4" floppy drive, input commands into the system, and type on a word processing program.  I was taught to use two spaces after every sentence, so I've been doing so for my entire life, but lately I've been noticing that if a sentence ends at the end of a line, the second space carries over to the next line, creating a weird one space indent.

I don't know if there are different conventions for spacing on a web page vs. spacing that is supposed to be printed, but as far as I know, you use two at all times.

TL;DR: Let's end this debate right now.  What is correct?  One or two spaces?