Smoking is bad for your health, but if you must do it.
There are designated smoking areas near most train stations and over locations where people gather. These can be very congested and a bit dirty.
But it is where you should smoke. Here is the link to the Japan Tabaco site and they have a series of posters to promote proper smoking manners
It is also advised to carry a portable ashtray for times when you've positioned yourself away from everyone (side street, etc) it not cool to throw your cig butts on the ground, so use the portable ashtray, it shows good manners.