You can set the acceptedMinecraftVersions property of your @Mod annotation to change which versions of Minecraft are allowed to run your mod. If your mod isn't actually compatible with a Minecraft version, it will likely crash at runtime when it encounters an incompatibility.
Look at VersionRange.createFromVersionSpec for brief documentation of the version range format. Look at FMLModContainer#bindMetadata to see how FML replaces some specific version ranges with others (where multiple versions are compatible with each other).