Yes, modulation is almost always a good idea if you're writing music of any length, unless you have a pressing reason to remain in one key (e.g. certain film score situations, etc.). Do it when you feel the key you're in has become boring.
Use any key you want. Generally, keys that are closely related -- that is, have a similar number of sharps or flats -- will provide the smoothest transition, while distant keys will be more jarring. A smooth transition is not always better. It depends on what you're trying to do with the music.
Regarding rules, it just has to sound good. That's the only rule you really need, unless you're specifically trying to imitate [insert composer or style here]. There are principles, certainly, that can help you achieve certain effects or prevent you from doing things that some people might regard as odd, but there are no rules.
Just a thought, but if you're having trouble with large-scale organization, it might help to plan out some basic things before you start writing. How long will the piece be? What keys will you use, and where? How will you approach those keys? Maybe come up with a few melodic ideas and decide where you want to introduce them (e.g. for the first 16 measures I will use x idea as the basis for my melody, then for the next 8 measures I will use y idea, then I'll modulate to G and use x idea again). If you can make some large decisions before you get lost in the details, it may help you keep things going.