Will I have to update my app when a new version of target mobile OS is released?

If a new version of the iphone or android OS is released will I need to update and release a new version of my app to target this or are they generally backwards compatible?

Being new to app development I’m trying to get an idea of how much ongoing maintenance there is once an app is released.