Except when necessary for takeoff and landing, the minimum safe altitude required for a pilot to operate an aircraft over other than congested area is an altitude of 1000 ft above the highest obstacle within a 2000 ft horizontal radius of the aircraft.
It is also good to know that apart from taking off and landing, the aircraft must not operate at a distance less than 500 ft from any person, vessel, structure or vehicle.