There are also several other approaches available:
Available aggregates to calculate.
Not all aggregates are available for all field types.
This approach is available since QGIS 2.16.
layer = iface.activeLayer()
max_value = layer.aggregate(QgsAggregateCalculator.Max, "name_of_your_field")[0]
print(max_value)
Contains utility methods for working with QgsVectorLayers.
This approach is available since QGIS 3.
layer = iface.activeLayer()
max_value = max(QgsVectorLayerUtils.getValues(layer, "name_of_your_field")[0])
print(max_value)
Similar to @Joseph's solution
layer = iface.activeLayer()
max_value = max([feat["name_of_your_field"] for feat in layer.getFeatures()])
print(max_value)