It depends on the application.
I've never used a typewriter in my life, but I learned that you always put two spaces after a period. So, that's what I always do, and it pissed me off a little bit when I realized that HTML only renders one space after a period.
But, in journalism, we learned always to use one space after a period for stories. So, if I'm writing up a story, I try to remember to put one space. Everywhere else I put two, including in this post right now, even though it won't display both spaces. It's just habit now.