There's a million ways to implement something like that, depending on what your "website" is. But it basically boils down to a simple condition:
$sitestatus = 0; // random variable name. 1 = 1, 0 = off
if($sitestatus == 0) {
// echo site is 'turned off' message
} else {
// display page or do whatever
}
You would have a hardcoded variable or a value in a column in a database or something in a flatfile or whatever. 1 = on, 0 = off. Then it's a simple matter of checking whether the variable is 1 or 0. You can do that in any language meant for "websites".