Stop displaying GUILabel when moving away/after time

So I created a script that when the player stands in front of an object, a text is displayed on screen. But when the player moves away, i also want the text to disappear. I’d also be happy with the text disappearing after a few seconds. I have tried to go for both ways but I couldn’t figure it out. Could someone help me please?

using UnityEngine;
using System.Collections;

public class karte : MonoBehaviour {

	bool map = false;
	bool text = false;
	public Texture MapDummy;
	string Message = "Halte 'O' gedrückt, um die Karte anzuzeigen";

	// Use this for initialization
	void Start () {

	}
	
	// Update is called once per frame
	void Update () {

		GameObject go = GameObject.FindGameObjectWithTag ("Player"); 
		RaycastHit hit;
		Ray landingRay = new Ray (go.transform.position, Vector3.forward);

		if (Physics.Raycast (landingRay, out hit, 10)) {
			if (hit.collider.tag == "PC") {
				text = true;
				if (Input.GetKeyDown (KeyCode.O)) {
					map = true;
				} else if (Input.GetKeyUp (KeyCode.O)) 
					map = false;
			
			} 
		}
	}

	
	void OnGUI () {

		if (text == true) {
			GUI.Label(new Rect(Screen.width/2,Screen.height/2,300,50),Message);
		}
		if (map == true) {
			
			GUI.DrawTexture (new Rect (0, 0, Screen.width, Screen.height), MapDummy);
				
		}
	}
}

I use a distance check to display a hovering name/description. I used almost this exact script for items, signs, enemies, NPC.

void OnGUI()
	{


		if (my_cam == null) {
			my_cam = GameObject.Find ("Main Camera").GetComponent<Camera>();
			
		} else {

			float distance_from = Vector3.Distance(transform.position, _player.gameObject.transform.position);

			if(distance_from <= sight_distance)
			{
				int label_w = 80;
				int label_h = 40;
				int label_offset_y = -60;
				
				GUI.color = current_color;

				Vector2 targetPos;
				targetPos = Camera.main.WorldToScreenPoint (transform.position);
				GUI.color = Color.black;
				GUI.Label (new Rect (targetPos.x - (label_w / 2) +1 , (Screen.height - targetPos.y) + label_offset_y +1, label_w, label_h), item_name);
				GUI.color = current_color;
				GUI.Label (new Rect (targetPos.x - (label_w / 2), (Screen.height - targetPos.y) + label_offset_y, label_w, label_h), item_name);

			}
		}
	}