The key issue here is deciding how you want to define 'weight bearing capacity'.
When you load a beam like this two important things happen firstly the beam deflects under the load and at the same time the stress in the beam increases.
By convention the 'strength' of a structure is the stress it can withstand before it is permanently deformed (ie does not return to its original shape when the load is removed). This occurs when the maximum stress in the structure exceeds the Yield Stress of the material. For ductile materials like aluminium and steel, this will not necessarily break the beam but it may cause it to fold up and collapse.
The second consideration is deflection. In some cases deflection may be unacceptable in design terms before yield stress is reached. For example if you want to support a pendulum from your beam with the bottom 10mm above the floor and the beam deflects 11mm you have a problem.
To actually calculate stress and deflection some standard formulas can be used for simple cases. Your example is closest to a simply supported beam with a point load
For simple cases these are easy enough to do on paper, or a quick search for beam loading calculator will find an online too to do the maths for you.
For more complex cases or for more detailed analysis finite element analysis software makes life much easier.
You will also need to calculate the Second Moment of Area (also called Moment of Inertia) for the beam you are interested in. For common industrial setions (tubes, I-beams etc) you can also just look it up for the particular section you are using.
A final consideration is factor of safety. For obvious reasons you don't want a structure to be right on the edge of collapse as all materials have tolerances and all of these calculations are based on assumptions which may or may not be 100% valid for any given case.
So you want to calculate a safe working load as some percentage of the maximum load before failure. How high a percentage this is depends on how confident you are that you have accounted for all variables and how serious the consequences of failure are.
Also there may be mandatory requirements in your jurisdiction for design of structures for particular applications especially buildings and other safety critical structures.
It is also important to add that the above assumes that the loads are static, moving loads can place much greater and more complex stresses on a structure and cyclic loads can also cause long term problems with fatigue