Despite the saying that Japanese cities never sleep, retail hours are often very limited. Opening hours of most shops are typically 10AM-8PM, though most shops are open on weekends and public holidays except New Year, and close on one day a week. Often that day is Monday, but can also be Tuesday or Wednesday. Restaurants typically stay open until late at night, though smoking would usually be allowed after 8PM.
However, you will always find a store open if you need one; Japan has an astounding number of 24/7 convenience stores (コンビニ konbini), such as 7-Eleven, Family Mart, Lawson, Circle K, and Sunkus. They often offer a much wider range of products than convenience stores in the US or Europe, sometimes have a small ATM and are often open all day all week! They sell delicious food, a wide array of beverages, books, magazines, music, and even basic clothing.
Many convenience stores also offer services such as fax, takkyubin luggage delivery, a limited range of postal services, payment services for bills (including topping up international phone cards such as Brastel) and some online retailers (e.g. Amazon.jp), and ticket sales for events, concerts and cinemas. Of course, establishments related to night life such as karaoke lounges and bars stay open well into the night: even in small towns it is easy to find an izakaya open until 5 am. Pachinko parlours are obliged to close at 11 pm.