You should check your bike before each ride: properly inflated tires, working brakes, and clean and lubricated bike chain/gears will ensure you're safe and comfortable when you head out. From there, it depends on how often you ride and under what conditions (e.g. street, gravel, mud), but cleaning and lubricating are still the key tasks. You may even want to take it to a bike shop for a tune-up every six months to a year.