The worst part about api reference is the lack of examples for doing a particular task. This does get better the more you work with it. 3ds max was particularly good with providing examples for just about anything in maxscript.
Blender on the other hand doesn’t do this, because maintaining examples through api changes requires a lot resources.
The link posted earlier does provide some examples (see the top of its page), but they don’t really explain the how, because it is assumed that the reader has a basic understanding to object-oriented programming (like eg. adding an attribute to a base type will propagate it to every child instance, etc.).
To create an integer property:
bpy.types.WindowManager.number = bpy.props.IntProperty()
To access and write the property from the python console:
>>> bpy.context.window_manager.number = 2
To access the property in a ui layout (assumes layout code):
layout = self.layout
To store the property along with the blend-file, set the property on a so-called
# Do not use the window manager (does not save properties)
bpy.types.Scene.number = bpy.props.IntProperty()
# Or any classes of bpy.types.ID.__subclasses__() excluding window manager.
To access the property on a future session, you would need to re-initialize the property on the base object. This is what addons do when they register on startup.