Squares on the pinboard

The pinboard has 3 × 3 pins.

How many squares can you make?

The corners must be on pins.

Squares in different places count separately.

What about 4 × 4 pins?