Q:

Making an object disappear when no longer visible on screen

I am making a simple ApplePicker prototype in Unity and am having trouble with destroying objects. In my script attached to my basket object I want to put this if statement in my Update() function which says that if an apple reaches a certain y value (i.e falls out of view), to destroy one of the baskets.
if(...) {
    Destroy(this.gameObject);
}

but I don't know what to put as a condition. can someone help me out? In case it is needed, the apple object has the tag "Apple"

A:

The transform variable which is a type of Transform is used to access the position, rotation and scale of any GameObject in the scene.
You would have to use  if (transform.position.y < someValue) to see if the position is less than any value or if (transform.position.y > someValue) to check if it is more than the value.
void Update()
{
    float someValue = 10;
    if (transform.position.y < someValue)
    {
        Destroy(this.gameObject);
    }
}

For rotation and scale, use transform.localEulerAngles and transform.localScale respectively.

Am I able to check the position of an apple from a script attached to
  the basket object, because I need to check the position of the apple
  not the basket

It's the-same thing. Find apple from your other script, store the reference then perform the-same action above.
GameObject apple;

void Start()
{
    //Find apple by tag
    apple = GameObject.FindWithTag("Apple");
}

void Update()
{
    float someValue = 10;
    if (apple.transform.position.y < someValue)
    {
        Destroy(apple);
    }
}

There is really a better way to check if object is no longer before destroying it. This removes the need of hard-coding the someValue value. Just check for the screen size.
GameObject apple;

void Start()
{
    //Find apple bt tag
    apple = GameObject.FindWithTag("Apple");
}

void Update()
{
    if (!IsVisibleOnScreen(apple))
    {
        Destroy(apple);
    }
}

private bool IsVisibleOnScreen(GameObject target)
{
    Camera mainCam = Camera.main;
    Vector3 targetScreenPoint = mainCam.WorldToScreenPoint(target.GetComponent<Renderer>().bounds.center);

    if ((targetScreenPoint.x < 0) || (targetScreenPoint.x > Screen.width) ||
            (targetScreenPoint.y < 0) || (targetScreenPoint.y > Screen.height))
    {
        return false;
    }

    if (targetScreenPoint.z < 0)
    {
        return false;
    }
    return true;
}

