The court considers various factors, including the length of the marriage, the income and earning capacity of each spouse, the standard of living during the marriage, and any prenuptial or postnuptial agreements.