I think that your experience may vary quite a bit depending on what type of journal you submit to and what type of submission system they use.
For journals that instruct you to send your manuscript to one of the editors directly via email, my experience has been that within a day or two you usually receive a terse reply thanking you for your submission and informing you that they will get the paper to a referee right away and will get back to you once they've heard back from the referee. The entire email is usually a sentence or two and is often the only thing you will hear from them for the next six months or so. If you sent your paper to an especially selective journal though, the editor may want to get a quick opinion about whether or not your paper is at the right level. In this case it may take up to a week to ten days to hear back from the editor.
For journals that have you submit via an online submission system, you should receive some sort of automatically generated confirmation of your submission more or less immediately. In my experience this is often the only email that I will receive until the refereeing process has ended. Oftentimes you'll be provided with a link to a website where you can track the status of your paper. In theory this should let you see that the paper is being assigned to an editor, has been sent to a referee, that the referee's report has been received, etc. I have found that more often or not you are simply told that the status of your paper is that it is "Under Review".
Once your paper makes it this far there really isn't anything you can do but wait. I have found that six months is about the average time it takes to receive a referee's report, though it might take a couple of months less if the paper is very short or a few months more if the paper is especially long or technical.
I think that once you've waited six months (perhaps a few months more or less depending on the length of your submission) it is reasonable to send a brief email to the editor inquiring about the status of your submission and asking when you might expect a report. Probably the editor will just reply by saying that your paper is still with the referee, though your email may result in the editor asking the referee for an update about when the report might be ready.
As for your fear that you'll have to wait a long time only to receive a rejection, unfortunately this happens all the time. For starters, it is not always that case that your paper will be sent to a referee immediately. It could take several weeks for this to happen. If your paper is especially technical or draws on techniques from a lot of different areas then it could take months for the editor to even find someone willing to referee the paper. You also have to remember that the person refereeing your paper is not being paid to do so. He has his own papers to write, classes to teach, etc. So for instance if you submit your paper right before a very busy time of year (say, when classes are just beginning) it could very well take a month or two for the referee to even bother printing out your paper and begin looking at it. And even then there is no guarantee that your long awaited report is going to provide you with useful feedback. I have certainly had multiple experiences in which I have waited six or eight months only to receive a three or four sentence report which made me question whether the referee even read past the introduction. In these situations I think you just have to have a thick skin and submit the paper again. On the other hand your paper may be rejected with a report that provides a lot of insightful feedback that helps you strengthen your paper. In this case I would hardly call the wait "a big waste of time".