The longer you wait to give/send them out, the more likely people will have other plans. To me, last minute invitations often mean the host didn't plan, or the recipient wasn't in the first round of invitees, or the host doesn't care if people come. Of course there are many reasons why impromptu parties might crop up, but birthdays (when you knew the date all year long) usually are presumed to have been thought of ahead of time. For toddler parties, a ton of invitations last minute conveys to some (rightly or wrongly) that the host just wants "credit" for inviting but really hopes half the people won't accept.
Are you buying (or making) regular invitations but you plan to hand them to people? Why wouldn't you mail them? It lets people get mail when they are able to deal with it and check their calendar, rather than stuffing an envelope in their purse (where they may misplace it) and feeling the obligation to reply to your face. If you're doing verbal invitations face-to-face, why print one out?
I'd say 3-4 weeks ahead, with RSVPs no more than a week from the event. (Much earlier RSVPs should only apply to major venues with a ton of catering, like a wedding or a charity event.) For a small at-home party for 3 year olds, I can't imagine why someone would need more than a week. Then at 4 days out if you still haven't heard, you can follow up.
There's often a problem when you invite school friends whose parents you don't know. There's the logistical problem of getting invitations to people whose home contact info you don't have, so you rely on the teachers to give out invites (worse: expecting kids to keep an invitation in the backpack). We see questions on Mamapedia all the time about things that got distributed through school and then the prospective guests don't reply - the host has no way to contact them and doesn't know why they didn't reply (didn't get it, didn't know who you are, are just rude or forgetful). I think, if you don't know the kids well enough to know the parents, you should figure out if it's really a good idea to invite the whole class and what the benefit is of having a huge room full of kids.
I think RSVP by text is fine if you are friendly enough with the person to have their contact info already in your phone already. Otherwise half the time people leave their name off and you have a "yes" or a "no" and you don't know who they are. That gets embarrassing. Email is fine if you have the name in your address book or if their email address is clear enough that you recognize it. I think a casual RSVP method is fine for casual parties. But I do think it's essential for them to have a phone number for you even if you request an email reply - and it's more personal and invites a direct conversation (or at least allows for the possibility).